How to deal with multiple date string formats in a python series

后端 未结 3 397
轮回少年
轮回少年 2021-01-05 17:41

I have a csv file which I am trying to complete operations on. I have created a dataframe with one column titled \"start_date\" which has the date of warranty start. The pro

3条回答
  •  再見小時候
    2021-01-05 17:54

    Not sure if this will help, but this is what I do when I'm working with Pandas on excel files and want the date format to be 'mm/dd/yyyy' or some other.

    writer = pd.ExcelWriter(filename, engine='xlsxwriter', datetime_format='mm/dd/yyyy')
    df.to_excel(writer, sheetname)
    

    Maybe it'll work with: df.to_csv

提交回复
热议问题