Py
Py
Run
What do you want to learn?
Lessons
⌄
Browse the curriculum
Find your level
Practice problems
Interview prep
Cheat sheets
Career paths
Explore by role
All lessons
Fundamentals
Web development
Data
Engineering
Data science
Machine learning
GenAI & RAG
Automation
DSA / interview
Tools
new
⌄
Online compiler
Playground
Revise
Terminal
SQL playground
Notebook
Build
⌄
Workspaces
Guided projects
My published sites
Blog
Pricing
AI
en
Sign in
Start free
→
Start free
→
loading…
Feedback
💬
Ask PyRun
Home
›
All lessons
›
Data
›
groupby & aggregation
groupby & aggregation
Advanced
15 min
Data
data · pandas · groupby · aggregation
Try it
↓
Lesson
9
of
10
In this track
▾
1
SQLite with Python's sqlite3
12 min
2
SQL joins that actually make sense
15 min
3
SQLAlchemy Core — SQL as Python
15 min
4
SQLAlchemy ORM — objects that persist
18 min
5
Database migrations with Alembic
15 min
6
Series & DataFrame: the two shapes of pandas
12 min
7
Cleaning messy data
14 min
8
Filtering, querying & top-N
12 min
9
groupby & aggregation
15 min
10
Combining tables: merge, join & concat
15 min
←
→
Loading lesson…
←
Previous lesson
Filtering, querying & top-N
Advanced · 12 min
Next lesson
→
Combining tables: merge, join & concat
Advanced · 15 min
Related lessons
Advanced · 12 min
Filtering, querying & top-N
Slice rows with boolean masks, read them cleanly with query(), then rank with sort_values and head() to answer top-N questions.
Advanced · 15 min
Combining tables: merge, join & concat
Stitch two tables together on a key with merge (inner vs left), understand which rows survive, and stack frames with concat.
Advanced · 14 min
Cleaning messy data
Real datasets arrive dirty: missing cells, wrong dtypes, duplicate rows. Fix them with isna/fillna/dropna, to_numeric, rename and drop_duplicates.