Home > Back-end >  How to convert "month-day" object to date format in pandas dataframe
How to convert "month-day" object to date format in pandas dataframe

Time:11-08

I have a df with a column:

column
Dec-01

The column datatype is an object.

I am trying to change it to a datatype date.

This is what I've tried:

df['column'] = pd.to_datetime(df['column']).dt.strftime(%d-%b')

This is the error I receive:

pandas._libs.tslibs.np_datetime.OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1-12-01 00:00:00

Would really appreciate you help

  • Related