Hello you can use import datetime and apply it to the column, then with .strftime()
you can change the format. Check more here
import datetime
x = datetime.datetime(2020, 3, 19)
x.strftime("%m %d %Y")
'03 19 2020'
Use strftime
In [2]: df = pd.DataFrame({'fecha_not' : ['2/3/2020', '6/3/2020', '7/3/2020', '9/3/2020', '9/3/2020'],
...: 'Estodo' : "Leve"})
...: df
Out[2]:
fecha_not Estodo
0 2/3/2020 Leve
1 6/3/2020 Leve
2 7/3/2020 Leve
3 9/3/2020 Leve
4 9/3/2020 Leve
In [3]: df['fecha_not'] = pd.to_datetime(df.fecha_not).dt.strftime('%d/%m/%Y')
...: df
Out[3]:
fecha_not Estodo
0 03/02/2020 Leve
1 03/06/2020 Leve
2 03/07/2020 Leve
3 03/09/2020 Leve
4 03/09/2020 Leve
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.