0

Why the following line of code

df['Startdate'] = pd.to_datetime(df['Startdate'].dt.strftime('%d/%m/%Y'))

won't change the following dataframe df with type datetime64[ns] from:

      Startdate
0    2020-10-05
1    2002-04-18
2    2002-07-22
3    1980-02-25
4    2015-01-05
5    2014-08-14
6    2015-09-14
7    2019-05-01
8    2018-08-28
9    2004-09-01
10   2007-04-02
11   1995-04-01
12   2019-01-10

to:

     Startdate
0   05/10/2020
1   18/04/2002
2   22/07/2002
3   25/02/1980
4   05/01/2015
5   14/08/2014
6   14/09/2015
7   01/05/2019
8   28/08/2018
9   01/09/2004
10  02/04/2007
11  01/04/1995
12  10/01/2019
halfer
  • 19,824
  • 17
  • 99
  • 186
Stacey
  • 4,825
  • 17
  • 58
  • 99

0 Answers0