Python for ML Engineers

The Python that ML code is actually written in: types, generators, decorators, context managers and a test suite.

Module 02.1 · Beginner
Free

10h · 7 lessons · 1 challenge

About this module

Not an introduction to programming. This is the subset of Python that ML codebases lean on — iterators and generators for data loading, decorators for instrumentation, context managers for devices and precision, dataclasses for configuration — plus enough packaging and testing that your take-home runs on the reviewer's machine.

Skip it if you already write Python professionally; the placement quiz will tell you.

After this module you can

7 lessons

Lesson 1
Types, dataclasses and configuration
Kind
Concept
Length
50 min
Lesson 2
Iterators, generators and lazy pipelines
Kind
Concept
Length
55 min
Lesson 3
Decorators and context managers in ML code
Kind
Concept
Length
45 min
Lesson 4
Testing: fixtures, seeds and reproducibility
Kind
Lab
Length
70 min
Lesson 5
Packaging a project so it runs elsewhere
Kind
Lab
Length
60 min
Lesson 6
Profile Race: make it ten times faster
Kind
Interactive
Length
40 min
Lesson 7
Checkpoint: review this pull request
Kind
Checkpoint
Length
25 min

The challenge: Profile Race

A slow data script and a profiler. Find the hot line, fix it, run again. Scored on the speedup you get in five attempts.

Worth 350 XP.

Start of the track

NumPy & Vectorization

Related modules

All modules
NumPy & Vectorization
8h · 7 lessons
SQL & Data Modeling
8h · 7 lessons