how to convert multiple date formats in one format in pandas

后端 未结 2 1161
囚心锁ツ
囚心锁ツ 2021-01-19 04:57

I have following pandas dataframe with date column as object

   ID      Date                  Volume
   0       13-02-2018 00:06       85
   1           


        
2条回答
  •  迷失自我
    2021-01-19 05:11

    try this:

    df['Date'] = pd.to_datetime(df.Date)
    
    df['Date'] = df['Date'].dt.strftime('%Y-%m-%d %H:%M')
    

    link: Series.dt.strftime

提交回复
热议问题