I have a data frame in python.i need to change its data type from string object to datetime object. I need to forecast for next year,for that the data type should be in datetime. week number goes upto (2015-52)
WeekKey SalesVolume
0 2015-02 444
1 2015-03 1451
2 2015-04 2556
3 2015-05 3762
4 2015-06 4883
current data type is as follows.
Data columns (total 2 columns):
0 WeekKey 60 non-null object
1 SalesVolume 60 non-null int64
dtypes: int64(1), object(1)
I tried
df_data['WeekKey'] = pd.to_datetime(df_data['WeekKey'], format='%Y-%W')
but getting an error.
TypeError: Unrecognized value type: <class 'str'>
ValueError: Cannot use '%W' or '%U' without day and year
Please help me to sort this out.