Continuing on my previous question, I have another dataframe that the week column starts with 201553. When I change weekly columns to timestamp, belwo occured. Please take a look.
a = pd.Int64Index([201553, 201601, 201602, 201603, 201604, 201605, 201606, 201607,
201608, 201609])
print (pd.to_datetime(a.astype(str) + '1', format='%Y%W%w'))
DatetimeIndex(['2016-01-04', '2016-01-04', '2016-01-11', '2016-01-18', '2016-01-25',
'2016-02-01', '2016-02-08', '2016-02-15', '2016-02-22',
'2016-02-29'],
dtype='datetime64[ns]', freq=None)
Notice that my first index starts with 201553 and when I change into DatatimeIndex, it shows '2016-01-04' which is wrong. I want need to have '2015-12-28' for the first index. Is there a way to change only the first index of a? Please let me know. Thanks!
-------edit------- 201553 means year 2015, 53rd week. If you see the DatetimeIndex, each date is Monday of each week. So week number 53 in year 2015 should start with '2015-12-28', but my DatatimeIndex is showing '2016-01-04'. All I need to do is fix this. Hope this makes more sense to everyone. Sorry for the confusion. Thanks!
-------edit2------ I kinda self-solved the question. I changed the a.index[0] to 201552 and it gave me the exact date I want. But still, I want to find out correct way to solve this problem. Thanks