'Convert a Dytpe object to a date

In my dataset named "Monthly_total_spend" I have one column named "Date" that shows the Month and Year of my data. I would like to convert this column from a Dtype object to a Dtype date.

I used this code:

Monthly_total_spend['Date']= pd.to_datetime(Monthly_total_spend['Date'])

This is my error:

OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1-01-21 00:00:00


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source