I have a pandas dataframe with column with dates (datetime64[ns] format) The dates are listed as yyyy-mm-dd (like 2018-09-12). I want to convert it to dd-mm-yyyy but what i try doesn't seem to works:
pd.to_datetime(df['date'], format='%d-%m-%Y')
0 2018-09-12
1 2018-09-12
Edit: add example df
df.head(3)
date nr
0 2018-09-12 144
1 2018-09-12 37
2 2018-09-12 28
df.info()
date datetime64[ns]
nr int
The 'date' doesn't contain any Nan's or Nat's