Milestone: Pandas SQL Equivalents

Re-implement GROUP BY, JOINs and window ranking in pandas

20 min · interactive lesson with runnable code.

What you'll be able to do

  • Translate GROUP BY … COUNT/AVG … HAVING into groupby().agg()
  • Do inner and left joins with merge and handle the NaNs a left join creates
  • Rank rows within groups with groupby().rank()

The full lesson is free with an account.

The milestone

SQL → pandas translation table

Task 1 — GROUP BY with aggregation

Task 2 — Inner and left joins

Task 3 — Window-style ranking

Self-check and done when