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

前端 未结 7 1920
清酒与你
清酒与你 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:46

    I got some help from a colleague.

    This appears to solve the problem posted above

    pd.to_datetime(df['mydates']).apply(lambda x: x.date())

提交回复
热议问题