Work with real shapes of data / CORE PATH
Sets & reconciliation
Sets answer membership and difference questions without keeping duplicates.
Use set differences to find missing foreign keys before a warehouse load.
Understand the idea
Sets answer membership and difference questions without keeping duplicates. Use set differences to find missing foreign keys before a warehouse load.
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
- Use intersection, union and difference.
- Compare observed keys with a reference set.
- Sort results for deterministic reports.
A small original example
observed = {1, 2, 2, 4}
reference = {1, 4}
print(sorted(observed - reference))Practice on your own data
Task 11: report profile IDs absent from the reference set.
Practice this lesson in the Python lab →
missing_ids([1, 2, 2, 4], [1, 4]) is [2].
Common pitfalls
- set iteration order is not a reporting contract.
- {} creates an empty dict; set() creates an empty set.
Prerequisites
Boot.dev chapter 11 · 06:19:51 ↗
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.
Sources and further reading
- Boot.dev · Python for Beginners ↗User-selected YouTube course
- كورس Python منحة ITI ↗User-selected ITI playlist
- Harvard CS50P · lectures & problem sets ↗User-selected HarvardX CS50P course
- Python language tutorial ↗Official documentation
Track progress on this topic → · Markdown source ↗