I have a dataframe of sales information by customers by month period, that looks something like this, with multiple customers and varying month periods and spend:
customer_id month_year sales
0 12 2012-05 2.58
1 12 2011-07 33.14
2 12 2011-11 182.06
3 12 2012-03 155.32
4 12 2012-01 71.24
As you can see, for each customer many of the months are missing. I would like to add additional rows for each customer, with sales = 0.0, for all of the months in the range of month_year.
Can anyone advise the best way to do this?