pySohila’s learning labPYTHON / FIELD GUIDE 01

Work with real shapes of data / CORE PATH

Dictionaries & grouping

Mappings connect unique keys to values and support lookup and grouping.

3h planning budget · Sohila Khaled Abbas · Reviewed 2026-11-01

Implement a small GROUP BY yourself before using pandas groupby.

Understand the idea

Mappings connect unique keys to values and support lookup and grouping. Implement a small GROUP BY yourself before using pandas groupby.

Work through the practice with a tiny fixture, predict the result before running it, and record one boundary case. Use the exit check as evidence before moving on.

What to learn

A small original example

totals = {}
for row in [{"category": "Food", "amount": 300}, {"category": "Food", "amount": 200}]:
    key = row["category"]
    totals[key] = totals.get(key, 0) + row["amount"]
print(totals)

Practice on your own data

Task 10: group transaction piastres by category.

Practice this lesson in the Python lab →

EXIT CHECK

Two Food rows with 300 and 200 produce {"Food": 500}.

Common pitfalls

Prerequisites

Lists, slices & comprehensions

Boot.dev chapter 10 · 05:44:48 ↗

Video and playlist companions

Choose one explanation for the concept, then attempt the practice. These are topic mappings, not a claim that every linked lesson covers every outcome.

Boot.dev · Python for Beginners

Loads YouTube on request. Open on YouTube ↗ if the owner restricts embedding.

كورس Python منحة ITI

Loads YouTube on request. Open on YouTube ↗ if the owner restricts embedding.

Python Full Course for Beginners (13 Hours) – From Zero to Hero

Loads YouTube on request. Open on YouTube ↗ if the owner restricts embedding.

Sources and further reading

Track progress on this topic → · Markdown source ↗