Convert Atypical Date Format for Time Series in Python I have an atypical time format that I need to convert into a datetime index for time series analysis.  I'm working in Python / Pandas.

The column is 'BC_DT', and the format is "27-MAR-18".  Example is below.

BC_DT
27-MAR-18
28-MAR-18
29-MAR-18


I tried this method, but I'm getting an error: ValueError: time data '27-MAR-18' does not match format '%d-%b-%Y'

df['Converted_Date'] = df['BC_DT'].apply(lambda x: dt.datetime.strptime(x, '%d-%b-%Y'))
Let pandas determine what datetime format you are using automatically. 

import pandas as pd
raw_data = pd.DataFrame(data={'BC_DT':['27-MAR-18','28-MAR-18','29-MAR-18']})
raw_data['BC_DT'] =  pd.to_datetime(raw_data['BC_DT'])
print(raw_data)



  BC_DT 0:   2018-03-27 1:  2018-03-28 2:  2018-03-29