My date field CRT_DT has dates coded as follows 1190314 which represents the following date March 14th 2019, also 03/14/2019 990201 which represents the the following date February 1st 1999, also 02/01/1999
I would like to make a field that normalizes this date field to regular dates, so for the above it would have 03/14/2019 and 02/01/1999. The rule is that if it starts with a "1" then replace it with a "20" and convert it to date type, if it begins with "9" then add a "19".
df['CRT_DT_Fix'] =
np.where(df['CRT_DT'].str.slice(stop=1)='1','20'+df['CRT_DT'].str.slice(start=2),'19'+df['CRT_DT'].str.slice(start=2))