here is a column which has timestamp in string format.

order_purchase_col.head()

0    2017-09-13 08:59:02
1    2017-04-26 10:53:06
2    2018-01-14 14:33:31
3    2018-08-08 10:00:35
4    2017-02-04 13:57:51
Name: order_purchase_timestamp, dtype: object

convert it to datetime format with to_datetime method

order_purchase_col = pd.to_datetime(order_purchase_col)
order_purchase_col.head()


0   2017-09-13 08:59:02
1   2017-04-26 10:53:06
2   2018-01-14 14:33:31
3   2018-08-08 10:00:35
4   2017-02-04 13:57:51
Name: order_purchase_timestamp, dtype: datetime64[ns]

0 Comments

Leave a Reply

Your email address will not be published.