So I try to convert an object to pandas datetime with the to_datetime option. However it is not working.
My code:
ship_date = pd.to_datetime(d['shipmentDate'])
print(ship_date.head())
Output:
0 2019-11-08 18:57:31+01:00
1 2019-11-08 16:30:02+01:00
2 2019-11-08 15:28:32+01:00
3 2019-11-08 11:56:32+01:00
4 2019-11-08 11:56:02+01:00
Name: shipmentDate, dtype: object
Even when trying to use format like so:
ship_date = pd.to_datetime(d['shipmentDate'], format='%Y-%m-%d %H:%M:%S%z')
I still get an object and not a datetime. What am I doing wrong?