For the string = "4/3/09" using
df['dates'] = df['dates'].str.replace(r'([/ ]\d\d)\b', r'19\g<0>')
#or
df['dates'] = df['dates'].str.replace(r'([/ ]\d\d)$', r'19\g<0>')
I am getting 4/319/09 but I should get 4/3/1909
My data:
date_set = ['04/20/2009', '04/20/09', '4/20/09', '4/3/09',
'Mar-20-2009', 'Mar 20, 2009', 'March 20, 2009', 'Mar. 20, 2009',
'Mar 20 2009','20 Mar 2009', '20 March 2009', '20 Mar. 2009',
'20 March, 2009','Mar 20th, 2009', 'Mar 21st, 2009', 'Mar 22nd, 2009',
'Feb 2009', 'Sep 2009', 'Oct 2010',
'6/2008', '12/2009',
'2009', '2010']
If there is 2 digit year i need to add 1900. Ex - if year is 09, it should get replaced with 1909