Command
df.groupby
Explanation
df.groupby() is used to group data and apply aggregation functions.
Examples
Group by column and calculate mean
df.groupby("col1").mean()
Group by multiple columns and sum
df.groupby(["col1", "col2"]).sum()
df.groupby
df.groupby() is used to group data and apply aggregation functions.
Group by column and calculate mean
df.groupby("col1").mean()
Group by multiple columns and sum
df.groupby(["col1", "col2"]).sum()