df['date_column'] = pd.to_datetime(df['datetime_column']).dt.date
df['date_column'] = pd.to_datetime(df['datetime_column']).dt.date
df['date_only'] = df['date_time_column'].dt.date
[dt.to_datetime().date() for dt in df.dates]
pd.Timestamp('2014-01-23 00:00:00', tz=None).to_pydatetime()
import pandas as pd
#create DataFrame
df = pd.DataFrame({'stamps': pd.date_range(start='2020-01-01 12:00:00',
periods=6,
freq='H'),
'sales': [11, 14, 25, 31, 34, 35]})
#convert column of timestamps to datetimes
df.stamps = df.stamps.apply(lambda x: x.date())
#view DataFrame
df
stamps sales
0 2020-01-01 11
1 2020-01-01 14
2 2020-01-01 25
3 2020-01-01 31
4 2020-01-01 34
5 2020-01-01 35
df = pd.DataFrame({'year': [2015, 2016],
'month': [2, 3],
'day': [4, 5]})
pd.to_datetime(df)
0 2015-02-04
1 2016-03-05
dtype: datetime64[ns]