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

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


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())


Much simpler than above:

df['mydates'].dt.date


For me this works:

from datetime import datetimedf[ts] = [datetime.fromtimestamp(x) for x in df[ts]]