-3

I have a huge column named Date of str with this format: year-month-day and I want to convert it into a DateTime type

Can someone help me, please :)

2 Answers2

0

this should fix your problem

df['Date'] = pd.to_datetime(df['Date'])
Inder
  • 3,521
  • 8
  • 25
  • 38
0

There you go :)

from datetime import datetime

datetime_object = datetime.strptime('2018-07-17', '%Y-%m-%d')
pascscha
  • 1,424
  • 8
  • 16