I am attempting to downsample monthly data to weekly data and have a time series dataframe of months that looks like this:
qty
PERIOD_NAME
2017-09-01 49842.0
2017-10-01 27275.0
2017-11-01 29159.0
2017-12-01 51344.0
2018-01-01 19103.0
2018-02-01 23570.0
2018-03-01 45139.0
2018-04-01 25722.0
2018-05-01 22644.0
I've attempted using a resample to weeks like this:
tgt_item_by_445_wk = tgt_item_by_445_wk.resample('W').sum()
which yields:
qty
PERIOD_NAME
2017-09-03 49842.0
2017-09-10 0.0
2017-09-17 0.0
2017-09-24 0.0
2017-10-01 27275.0
2017-10-08 0.0
2017-10-15 0.0
2017-10-22 0.0
2017-10-29 0.0
I've tried interpolation, but I can't get what I am looking for, which is a fill of the unsampled (0's) with an even split of the first value like this:
qty
PERIOD_NAME
2017-09-03 12460.5
2017-09-10 12460.5
2017-09-17 12460.5
2017-09-24 12460.5
2017-10-01 5455.0
2017-10-08 5455.0
2017-10-15 5455.0
2017-10-22 5455.0
2017-10-29 5455.0
Is there some method using resample, fills and interpolation that allows this?