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.

Level: beginnerTopic: NumPy pandas visualization

pandas groupby: an example

df.groupby('city')['revenue'].mean() gives the average revenue for each city.

Related terms

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.