Python/Pandas convert string to time only

后端 未结 4 508
伪装坚强ぢ
伪装坚强ぢ 2020-12-02 20:38

I have the following Pandas dataframe in Python 2.7.

import pandas as pd
trial_num = [1,2,3,4,5]
sail_rem_time = [\'11:33:11\',\'16:29:05\',\'09:37:56\',\'21         


        
4条回答
  •  鱼传尺愫
    2020-12-02 21:13

    This seems to work:

    dfc['Time_of_Sail'] = pd.to_datetime(dfc['Time_of_Sail'], format='%H:%M:%S' ).apply(pd.Timestamp)

提交回复
热议问题