Learn Before
Concept
Pandas Groupby Aggregation Functions
When you perform a groupby on a pandas dataframe, you must then specify what will happen with the rest of the columns. The easiest way to do this is by putting .sum(), .mean(), etc. this will perform that operation on all the remaining columns. If you would like a custom function, use the .agg() function and input a custom funtion
0
1
Updated 2021-09-28
Tags
Data Science