Incognito
Incognito

Reputation: 351

Descriptor 'date' requires a 'datetime.datetime' object but received a 'Series' (Python)

So, I have the following DataFrame:

enter image description here

I would like to convert those datetime values to date, so I tried:

df['Notification Date']= datetime.date(df['Notification Date'])

What am I doing wrong?

Upvotes: 0

Views: 116

Answers (1)

Quang Hoang
Quang Hoang

Reputation: 150745

You should use pd.to_datetime for pandas series:

df['Notification Date'] = pd.to_datetime(df['Notification Date'])

Upvotes: 2

Related Questions