Advertisement
Dodma

Untitled

Jun 19th, 2020
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. cohorts_sources = orders.groupby(['first_order_month', 'order_month','source_id']).agg({'buy_ts':'count','revenue':'sum'}).reset_index()
  2. cohorts_sources = cohorts_sources.rename(columns={'buy_ts': 'n_orders', 'revenue':'revenue_per_month'})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement