Use the pandas to_datetime
function to parse the column as DateTime. Also, by using infer_datetime_format=True
, it will automatically detect the format and convert the mentioned column to DateTime.
import pandas as pd
raw_data['Mycol'] = pd.to_datetime(raw_data['Mycol'], infer_datetime_format=True)