I have a dataframe with dates in the following manner:
'Jan 2019', 'Feb 2019', 'M?r 2019', 'Apr 2019', 'Mai 2019', 'Jun 2019', 'Jul 2019', 'Aug 2019', 'Sep 2019', 'Okt 2019', 'Nov 2019', 'Dez 2019'
I am trying to convert the column to datetime using
pd.to_datetime(df.month, format='%b%Y', errors='ignore')
Unfortunately, to_datetime
retuns objects instead of datetimes. I believe it's because of the German spelling of the date (e.g. 'M?r 2019' instead of 'Mar 2019' or 'Dez 2019' instead of 'Dec 2019').
What would be a good general solution to this problem?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…