I have a time series of data in the following form:
| purchase_date | cutomer_id | product
2018-10-31 id1 prod1
2018-11-14 id1 prod1
2019-01-05 id1 prod2
...
2019-03-07 id1 prod30
2019-03-31 id2 prod31
2018-04-07 id2 prod2
...
I am trying to resample this data weekly to fill in missing weeks and fill NaN values using most frequent value efficiently. Everything I have tried is way too slow for dataset this big (almost billion rows). Any ideas on how to do this efficiently?
groupby
andapply
combination? $\endgroup$ – bradS Oct 21 at 15:13