Reputation: 69
How can I convert string column to datetime in pandas?
My columns is as follows
Date
01Jan2019
01Feb2019
01Mar2019
How can I convert this to a pandas date time?
Upvotes: 0
Views: 69
Reputation: 82
The following code will convert your String column to datetime64
df['Date'] = pd.to_datetime(df['Date'], infer_datetime_format=True)
Upvotes: 1
Reputation: 484
Could you try with below code
from datetime import datetime
datetime_object =datetime.strptime('01Jan2019', '%d%b%Y')
Upvotes: 0