How do I convert timestamp to datetime.date in pandas dataframe?

前端 未结 7 1913
清酒与你
清酒与你 2020-12-03 14:03

I need to merge 2 pandas dataframes together on dates, but they currently have different date types. 1 is timestamp (imported from excel) and the other is datetime.dat

7条回答
  •  我在风中等你
    2020-12-03 14:47

    If you need the datetime.date objects... then get them through with the .date attribute of the Timestamp

    pd.to_datetime(df['mydates']).date
    

提交回复
热议问题