Reputation: 23214
I have a dataset that contains data like so:
Customer, Quarter, TotalSales
Customer1, Q1, 2000
Customer2, Q1, 1232
Customer1, Q2, 432423
Customer2, Q2, 2222
Customer1, Q3, 242343
...
We would like to interpolate this into a more fine grained view, based on individual dates. Is it possible somehow to smooth the sales data out for the 3 months in each quarter, so that the total sale for that quarter is still the same, but still align the values to match the data of the days of the Quarters before and after?
Customer, Quarter, Daily Sales
Customer1, 2020-01-01, interpolated value
Customer1, 2020-01-02, interpolated value
Customer1, 2020-01-03, interpolated value
....
Customer1, 2020-01-31, interpolated value
^ sum of these still add up to Customer1, Q1, 2000
...
Upvotes: 0
Views: 309
Reputation: 116
There is a class of methods known as "temporal disaggregation" methods. Look at this package on GitHub. Basically, you can specify a lower frequency time series and convert it (extrapolate) a higher frequency one. I've only used this package in R but it seems that the python implementation should be pretty much the same. You can specify whether the higher frequency observation should sum up to the lower frequency ones (or some other value).
Upvotes: 1