Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. df_by_position = df.groupby(df.position.apply(lambda x: round(x, 0))).agg({
  2. "clicks": "sum", "impressions": "sum"
  3. })
  4. df_by_position['ctr'] = (df_by_position.clicks / df_by_position.impressions)*100
  5. df_by_position[df_by_position.index <= 20].ctr.plot(title="Click Through Rate (CTR) by Position")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement