Python 1001

Free course · 12 hands-on notebooks · runs on any laptop

Python 1001

From data structures to deploying services, compiled extensions and research-grade science. Three modules, Intro, Medium and Advanced, each a set of notebooks with real, executed results you can read here or run yourself.

  • 12notebooks
  • ~15 hof study
  • 3levels
  • 100%runnable code

Measured, not claimed

Every comparison in the course is run: file formats timed, memory peaks measured per process, speed-ups benchmarked, models scored on held-out data. When a technique does not help, the notebook says so.

From script to production

Environments, lock files, Docker, testing, logging, packaging and publishing: the practices that turn code that runs on your machine into software other people can use.

Python at the frontier

The Advanced module uses the libraries researchers rely on, in biology, medicine, physics, space, economics and AI, and ends with a complete Kaggle challenge.

Syllabus

Three modules, 12 notebooks. Read the explanations, run the cells, then try the exercises at the end of each notebook. Your progress is remembered in this browser.

Module 1

Intro

Data structures, formats, data larger than memory, environments, containers and editors.

Module 2

Medium

Object-oriented and Pythonic programming, testing, concurrency, and building, publishing and maintaining libraries.

Module 3

Advanced

Python at the frontier: biology, medicine, physics, space, economics, AI frameworks and a Kaggle capstone.

08

Life Sciences: Biology and Medicine

Sequences, simulated evolution and a reconstructed family tree with Biopython, survival analysis of a breast-cancer trial with lifelines, and a diagnostic model tuned for sensitivity.

  • Biopython
  • alignment
  • phylogeny
  • Kaplan-Meier
  • Cox regression
  • ROC
⏱ ~75 min💻 runs in 20 s on a CPU
09

Physics and Space Research

Derive a pendulum symbolically with SymPy, simulate it with SciPy, find its frequency with an FFT, verify Kepler's third law with Astropy, and integrate an orbit checked by conservation laws.

  • SymPy
  • SciPy ODEs
  • FFT
  • Astropy units
  • Kepler
  • orbits
⏱ ~75 min💻 runs in 20 s on a CPU
10

Economics and Econometrics

Fifty years of US data with statsmodels: Okun's law with robust standard errors, its stability across decades, and an ARIMA forecast backtested against naive baselines.

  • statsmodels
  • OLS & HAC
  • Okun's law
  • ARIMA
  • backtesting
⏱ ~60 min💻 runs in 40 s on a CPU
11

AI Frameworks: PyTorch and TensorFlow

The same convolutional network in PyTorch and in TensorFlow/Keras: tensors, automatic differentiation, training loops, saving and exporting, and how to choose.

  • PyTorch
  • TensorFlow
  • Keras
  • autograd
  • CNN
  • ONNX
⏱ ~60 min💻 runs in 30 s on a CPU
12

Capstone: Solving a Kaggle Challenge

Kaggle's House Prices challenge end to end: licensing, the log-RMSE metric, exploration, feature engineering in a Pipeline, cross-validation, blending and a submission file.

  • Kaggle
  • data licensing
  • feature engineering
  • Pipeline
  • cross-validation
  • blending
⏱ ~120 min💻 runs in 1 min on a CPU

Run it yourself

Each lesson page shows the notebook with its saved outputs, so the whole course can be read in the browser. To experiment, download a notebook or open it in Google Colab from the lesson page, or clone the repository and run everything locally (module 04 explains every step of this):

git clone https://github.com/fborbon/academy.git
cd academy/python
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
jupyter lab

What you need

  • Python: none for the Intro module beyond having written a few lines of code; each module builds on the previous one.
  • Maths: school level. The Advanced notebooks explain the science they use as they go.
  • Hardware: any laptop from the last decade. Every notebook runs on a CPU in minutes; the Kaggle capstone downloads a 1 MB dataset once.

Data and credits

  • Most data is generated in the notebooks or ships with the libraries (scikit-learn, statsmodels, lifelines).
  • Ames Housing data: De Cock, D. (2011), Journal of Statistics Education 19(3), via OpenML (public).
  • GBSG2 breast-cancer trial: Schumacher et al. (1994), Journal of Clinical Oncology, as distributed with lifelines.
  • US macroeconomic data: as distributed with statsmodels (macrodata).
  • Planetary orbital elements: standard published values (NASA planetary fact sheets).