I have the following dataframe:
n startdate enddate count
0 1 2014-02-01 2014-02-01 6069
1 1 2014-02-01 2014-03-01 1837
2 1 2014-02-01 2014-04-01 107
3 1 2014-02-01 2014-05-01 54
4 1 2014-03-01 2014-03-01 10742
5 1 2014-03-01 2014-04-01 2709
6 1 2014-03-01 2014-05-01 1387
7 1 2014-04-01 2014-04-01 5584
8 1 2014-04-01 2014-05-01 1103
9 1 2014-05-01 2014-05-01 2970
Is it possible to transform it into something similar to:
n startdate 2014-02-01 2014-03-01 2014-04-01 2014-05-01
0 1 2014-02-01 6069 1837 107 54
1 1 2014-03-01 0 10742 2709 1387
2 1 2014-04-01 0 0 5584 1103
3 1 2014-05-01 0 0 0 2970
Thanks!
groupby,unstack, and maybesum