Educational Cards
Learn from video content, text, and interactive tasks
Filters
Broadcasting and boolean masks
Broadcasting is NumPy's rule for combining arrays of different shapes. When the shapes are...
Reductions, statistics, and views vs copies
The real reason to switch is vectorisation : you write whole-array expressions and NumPy does the...
Counting and accumulating per key
Most analytics questions have the same shape: split the rows into groups by some key, then reduce...
Type hints and a numeric helper
As projects grow, functions become the way you organise them. A function with type hints states its...
Transpose and the ragged-row pitfalls
A close cousin of column iteration is the transpose , which turns rows into columns by swapping the...
Matrices: indexing, row and column sums
Real data is usually two-dimensional: a grid of rows and columns. A spreadsheet, a feature table, a...
Why loops first, and the length pitfall
Every operation here is a Python-level loop that pays a small cost for each element. On three...
Lists as vectors: scaling and the dot product
A column of numbers — prices, scores, temperatures — is a vector , and in plain Python a vector is...
Parsing rows and the bool('False') trap
Now combine the two ideas: a function that turns one raw row of strings into properly typed values....
Measurement scales and your first function
Everything read from a CSV is a string, so before you can compute you must parse each value into...
Graphs: relationships as data and algorithms
A graph is relationships as data : nodes connected by edges . Social networks, task dependencies,...
Chunked reading and single-pass generators
The practical payoff is reading a huge file in fixed-size chunks rather than loading it whole:...