SkyAICampus
HomePracticeLearnCode LabFocus
SkyAICampus
PrivacyTermssupport@skyaicampus.com© 2026 SkyAI Campus
Log inSign up

Learn

HomePracticeConcept cardsCode LabSky Tutor

Review

Revise todayMistake notebookProgress

Focus

Campus ForestFocus roomsSquads

Questions or feedback?
support@skyaicampus.com

  1. 1Series and DataFrames
  2. 2Filtering and sorting
  3. 3GroupBy and aggregation
  4. 4Cleaning data
  5. 5Combining data
← Pandas

Lesson 3 of 5

GroupBy and aggregation

Watch, read the card, then practise. groupby basics · Several summaries at once · Counting values

Video coming soon

The video for this lesson is being recorded.

Meanwhile, the notes below and the 60-second cards cover the same ideas.

Practise this topic
  • groupby basics

    groupby splits the table into groups and summarises each one.

    Remember: Split, apply, combine.

  • Several summaries at once

    agg lets you work out several summaries at once.

    Remember: One groupby, many summaries with agg.

  • Counting values

    value_counts counts how often each value appears in a column.

    Remember: Quickest way to see what's in a column.

Try the example in Code Lab

import pandas as pd
df = pd.DataFrame({"city": ["Pune", "Delhi", "Pune"], "marks": [82, 67, 91]})
print(df.groupby("city")["marks"].mean().to_dict())
← Filtering and sortingNext: Cleaning data →

In this lesson

  • groupby basics
  • Several summaries at once
  • Counting values

Practise this topic

5 questions at your level. The best way to make it stick.

Practise 5 questions