If we look at one of the series rows, we’ll see it’s a Timestamp object:
time_stamps[0]
Will return:
Timestamp('2022-01-01 00:00:00')
We can obviously convert the Timestamp individually, but we would prefer to instead convert the entire Series to a list of Python Datetimes using a list comprehension:
dt_lst= [element.to_pydatetime() for element in list(time_stamps)]
Convert a DataFrame column of timestamps to dates
#create a DataFrame
times = pd.DataFrame (time_stamps, columns=['time_ts'])
times['time_dt'] = pd.to_datetime(times['time_ts']).dt.date
times