1import pandas as pd
2df = pd.read_csv(file_path)
3
4df['Dates'] = pd.to_datetime(df['date']).dt.date
5df['Time'] = pd.to_datetime(df['date']).dt.time
1df = pd.DataFrame({'my_timestamp': pd.date_range('2016-1-1 15:00', periods=5)})
2
3>>> df
4 my_timestamp
50 2016-01-01 15:00:00
61 2016-01-02 15:00:00
72 2016-01-03 15:00:00
83 2016-01-04 15:00:00
94 2016-01-05 15:00:00
10
11df['new_date'] = [d.date() for d in df['my_timestamp']]
12df['new_time'] = [d.time() for d in df['my_timestamp']]
13
14>>> df
15 my_timestamp new_date new_time
160 2016-01-01 15:00:00 2016-01-01 15:00:00
171 2016-01-02 15:00:00 2016-01-02 15:00:00
182 2016-01-03 15:00:00 2016-01-03 15:00:00
193 2016-01-04 15:00:00 2016-01-04 15:00:00
204 2016-01-05 15:00:00 2016-01-05 15:00:00