
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

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
There's a answer over here: pandas to_datetime parsing wrong year
It's due to 2 digit years from 0-68 mapping to 20xx.
what if just replace years?
sf['Datum'] = pd.to_datetime(sf['Datum'].str.replace(r'(\d\d)$',r'19\1'))