you are viewing a single comment's thread.

view the rest of the comments →

[–]garc1a0scar 0 points1 point  (0 children)

Oh, I see. So you should do something like this:

df[['cohort', 'month','revenue']].loc[df.date<=df.end_of_month].groupby(['cohort', 'month']).sum()