← How-To Guides How-To How to use groupby in Pandas Use df.groupby('col') then .sum(), .mean(), .agg(), etc. groupby Split-apply-combine pattern. df.groupby('category')['value'].sum()