I load the attached excel file into python, but it does not detect the values in the cell in date format.
It treats cell values as Object.
How can I convert the year and week in the attached file (eg 2018(year)-16(week) to date type for use in python?
I used the code below but it is not working.
import datetime
def to_datetime(x):
return datetime.datetime.strptime(x + '-1', "%Y-%W-%w")
train['date'] = train['date'].apply(to_datetime)