Python — From Basics to Advanced · Pandas — Tabular Data Analysis
GroupBy and aggregations
Pandas — Tabular Data Analysis
Question 01 / 06
Complete computing each transaction’s share of amount within the per-user total.
df["share"] = df["amount"] / df.groupby("user")["amount"].___("sum")Pick the fragment that fills the gap: