One of the columns in my pandas dataframe looks like this:
14.3.2019
15.3.2019
16.3.2019
So this is European/German date that I have to convert to USA format:
2019-3-14
2019-3-15
2019-3-16
What is the fastest way to do it, possibly inplace, if I have a large dataset?
pd.to_datetime(df['date'], format='%d.%m.%Y').strftime('%Y-%m-%d')?pd.to_datetime(df['date_col'])?.dt:pd.to_datetime(...).dt.strftime? But, as suggested by @anky_91, don't use string, just usedatetimeformat, i.e., usepd.to_datetimeonly.