In [20]:
cohorts.loc[cohorts.shape[0],'FirstOrder']='2009-02'
cohorts.loc[cohorts.shape[0]-1,'OrderPeriod']='2010-03'
cohorts.loc[cohorts.shape[0]-1,'TotalUsers']=0
cohorts.sort_values(['FirstOrder','OrderPeriod'],inplace=True)
In [21]:
cohorts[cohorts['FirstOrder']=='2009-02']
Out[21]:
FirstOrder OrderPeriod TotalUsers
15 2009-02 2009-02 15.0
16 2009-02 2009-03 3.0
17 2009-02 2009-04 5.0
18 2009-02 2009-05 1.0
19 2009-02 2009-06 4.0
20 2009-02 2009-07 4.0
21 2009-02 2009-08 4.0
22 2009-02 2009-09 5.0
23 2009-02 2009-10 5.0
24 2009-02 2009-11 4.0
25 2009-02 2009-12 3.0
26 2009-02 2010-01 3.0
27 2009-02 2010-02 5.0
119 2009-02 2010-03 0.0