Course / 03
Programming in Python
Python from the first line to how the interpreter runs it: values and names, the built-in data structures and what they cost, functions, classes and the data model, packaging and type hints, testing and profiling, CPython internals and concurrency, then NumPy, pandas and Matplotlib.
Before you start: nothing beyond using a computer and a terminal. The course uses Python 3.14, and every Code section was run as written on 3.14.7 with its output shown; Python 3.15, released in October 2026, changes little of what the course shows, and the notes say where it does. Notes marked as optional depth go into how CPython works and can be skipped on a first reading. The machine-learning courses assume the first three sections and the Scientific Python section.
- 01
Getting Started
Running code, and the values, names and control flow every program is made of.
After this section: Run Python in a script, a REPL and a notebook, explain what a name refers to and when an object is shared, write functions with clear arguments, and handle text as Unicode.
5 of 5 notes published - 02
Data Structures
The built-in containers, what each operation costs, and how iteration works.
After this section: Choose between a list, tuple, dict and set by the cost of the operations you need, write comprehensions and generators, and read and write files with errors handled.
4 of 4 notes published - 03
Abstraction
Classes, the protocols that make objects behave like built-ins, and code split into modules.
After this section: Design a class with the data model's special methods, use closures and decorators, package code with a reproducible environment, and annotate it with type hints a checker understands.
5 of 5 notes published - 04
Reliable Code
Knowing that code works, and finding out why it does not.
After this section: Write tests with pytest, including fixtures and property-based tests, and find a bug or a slow spot with a debugger, logging and a profiler.
2 of 2 notes published - 05
Under the Hood
What the interpreter does with your code, and how to make it fast and concurrent.
After this section: Read the bytecode of a function, explain reference counting and the garbage collector, speed up a hot loop, and choose between threads, processes and asyncio, with and without the GIL.
3 of 3 notes published - 06
Scientific Python
The array, table and plotting libraries that the machine-learning courses use.
After this section: Vectorize a computation with NumPy broadcasting, clean and aggregate a table with pandas, and draw a clear figure with Matplotlib.
3 of 3 notes published