AI engineering glossary · NumPy pandas visualization
What is pandas groupby?
pandas groupby: A pandas operation that splits a table into groups sharing the same value in one or more columns, applies a calculation to each group, and combines the results. It answers questions like total sales per region and is the pandas counterpart of SQL GROUP BY.
pandas groupby: an example
df.groupby('city')['revenue'].mean() gives the average revenue for each city.
Related terms
- Split-apply-combine
- Aggregation
- Pivot table
- GROUP BY
More NumPy pandas visualization terms
Where you learn it
pandas groupby is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.