Educational Cards
Learn from video content, text, and interactive tasks
Filters
Memoization with lru_cache, safely
The most useful built-in decorator for data work is lru_cache , which memoizes : it remembers the...
Ranking, ties, and toward groupby
You usually want the result ranked . Sorting by a tuple key gives multi-level ordering, and a...
Functions as values; writing a decorator
In Python, functions are ordinary values: you can pass a function to another function and return a...
Explicit stacks and the recursion limit
The same traversal can be written iteratively with an explicit stack — a last-in, first-out pile of...
Project paths and feature pipelines
The same instinct produces small utilities that keep a project tidy. A recurring nuisance is file...
Recursion: base case and walking trees
A lot of data is a tree : nested JSON, a folder hierarchy, a category taxonomy. Recursion is a...
Measure first, then vectorise
Your intuition about where a program spends its time is almost always wrong, so you ask the program...
Reading the report; leakage and cross-validation
classification_report prints precision, recall and F1 per class — exactly the metrics you now...
A/B testing, sample ratio mismatch, and multiple comparisons
How big a sample does an A/B test need to detect a real effect? To detect an absolute lift d on a...
Thresholds, accuracy's lie, and computing metrics
A classifier doesn't output yes/no directly; it outputs a score , and you pick a threshold that...
Confusion matrix, precision, and recall
A model is only as trustworthy as your ability to judge it. Every prediction falls into one of four...
Basic types, records, and reading a CSV
Behind everything are Python's basic types , the vocabulary the rest of the course is built from: -...