Trying to parse dates on the format YYYY-WW to a Timestamp but this just yields the start date of the year, like so:
In [11]: pd.to_datetime('2015-09', format='%Y-%W')
Out[11]: Timestamp('2015-01-01 00:00:00')
Is this the expected behaviour? If so, how can I yield the "first day starting"?
You need specify also day of week:
print (pd.to_datetime('2015-09' + '-0', format='%Y-%W-%w'))
2015-03-08 00:00:00
print (pd.to_datetime('2015-09' + '-1', format='%Y-%W-%w'))
2015-03-02 00:00:00
print (pd.to_datetime('2015-09' + '-2', format='%Y-%W-%w'))
2015-03-03 00:00:00
More info is here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With