I want to convert (01-07-57) to date value

Viewed 31

enter image description here

I want to convert the datum column which is a string to DateTime format.

when I use

sf['Datum'] = pd.to_datetime(sf['Datum']).dt.date

its showing the year as 2057 instead of 1957

2 Answers

what if just replace years?

sf['Datum'] = pd.to_datetime(sf['Datum'].str.replace(r'(\d\d)$',r'19\1'))
Related