Since version 0.15.0 this can now be easily done using .dt to access just the date component:
df['just_date'] = df['dates'].dt.date
The above returns datetime.date, so object dtype. If you want to keep the dtype as datetime64 then you can just normalize:
df['normalised_date'] = df['dates'].dt.normalize()
This sets the time component to midnight, i.e. 00:00:00, but the display shows just the date value.
pandas.Series.dt
Videos
Since version 0.15.0 this can now be easily done using .dt to access just the date component:
df['just_date'] = df['dates'].dt.date
The above returns datetime.date, so object dtype. If you want to keep the dtype as datetime64 then you can just normalize:
df['normalised_date'] = df['dates'].dt.normalize()
This sets the time component to midnight, i.e. 00:00:00, but the display shows just the date value.
pandas.Series.dt
Simple Solution:
df['date_only'] = df['date_time_column'].dt.date
Use the to_datetime function, specifying a format to match your data.
df['Mycol'] = pd.to_datetime(df['Mycol'], format='%d%b%Y:%H:%M:%S.%f')
If you have more than one column to be converted you can do the following:
df[["col1", "col2", "col3"]] = df[["col1", "col2", "col3"]].apply(pd.to_datetime)