1 year ago

#379538

test-img

mor

Convert a column with a month number that does not match the date, date of month and year in Python

I have a column with a month number, which is not listed as a date so there are 2 errors with it that I want to correct:

  1. The count of the column starts from the month in which the count started(March), so in March the number 1 appears' I want to convert the date to the appropriate from.

  2. The counting continues even after the number 12, to the following numbers(13,14,15...) - and of course it is already in another year. How can I change that too?

I was trying to convert the column to date

df['month'] = datetime(df['month'])

But I did not succeed

cannot convert the series to <class 'int'>

python

pandas

datetime

date-conversion

0 Answers

Your Answer

Accepted video resources