Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cohorts_sources = orders.groupby(['first_order_month', 'order_month','source_id']).agg({'buy_ts':'count','revenue':'sum'}).reset_index()
- cohorts_sources = cohorts_sources.rename(columns={'buy_ts': 'n_orders', 'revenue':'revenue_per_month'})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement