Skip to content

The Ultimate Python for Data Science & Machine Learning Guide

Learn Python from zero, then use it for professional data analysis and machine learning. Every example runs on your own computer and shows its real output.
  • Absolute beginners. You have never written code. The course starts from zero and defines every term on first use.
  • Developers who are new to data. You know some programming, but not data science or machine learning. Skim the early modules and use the checkpoints to find your level.
  • Analysts who want more Python. You use spreadsheets or SQL and want to automate and scale your work.

You need a computer with macOS, Windows or Linux and an internet connection for the installation. You do not need any prior knowledge of statistics or machine learning.

Write professional Python

Use Python as a general-purpose language: the core language, the standard library, object-oriented programming, testing, tooling and Pythonic idioms.

Analyse data

Do professional data analysis with NumPy, pandas, Polars, SQL, statistics and visualization.

Build and ship models

Build, evaluate, tune, explain and ship machine learning models with scikit-learn, gradient boosting and PyTorch.

Each module teaches one topic through data science and machine learning tasks: sensor readings, customer records, sales tables. Each lesson also shows where the skill is used outside data science, for example in web development, automation and scripting.

Lessons with worked examples

Concepts first, then at least five worked examples per module. Each example solves a realistic task in small steps, with code and its real output.

25+ exercises per module

Warm-up, core and challenge exercises. Each has an expected output, starter code, hints and a full, tested solution.

Mini-projects

One project per module combines its skills, with a step plan, a rubric and a reference solution.

Cheat sheets

A quick reference for every module, plus a master cheat sheet for Python, OOP, data, ML and decision guides.

Checkpoints

Mixed exercises at the end of each Part and a rubric that tells you when you are ready for the next Part.

Capstones

Eight full projects, from a command-line tool to a deployed model, with milestones and grading rubrics.

The Parts build on each other. Part 4 needs Part 1 and two modules of Part 2. Part 5 needs Parts 3 and 4.

flowchart TB
  S["Start here"] --> P1["Part 1: Foundations"]
  P1 --> P2["Part 2: Advanced Python"]
  P2 --> P3["Part 3: OOP"]
  P1 --> P4["Part 4: Data analysis"]
  P2 -.->|"modules 10 and 13"| P4
  P3 --> P5["Part 5: Machine learning"]
  P4 --> P5
  P5 --> P6["Part 6: Math, stats & DSA deep dive"]
  P3 --> C1["Capstone 1"]
  P4 --> C2["Capstone 2"]
  P5 --> C3["Capstones 3–8"]

Each module has a lesson, exercises, a mini-project and a cheat sheet. The links below open the lesson.

The core language: values, text, control flow, data structures, functions, errors, files, packages and the standard library.

Part 2 · Intermediate and advanced Python

Section titled “Part 2 · Intermediate and advanced Python”

Generators, decorators, type hints, Pythonic style, testing, performance, web APIs and algorithms.

Classes, inheritance, the data model, dataclasses and design patterns. You build minilearn, a tiny scikit-learn-like library.

NumPy, pandas, data cleaning, EDA, charts, statistics, SQL and Polars.

The math, feature engineering, scikit-learn, classic models, tuning, unsupervised learning, time series, NLP, PyTorch, interpretability and deployment.

Part 6 · Math, statistics and algorithms deep dive

Section titled “Part 6 · Math, statistics and algorithms deep dive”

Advanced algorithms and ML data structures, linear algebra in depth, calculus and optimization (including reverse-mode autograd), Bayesian statistics and information theory, and causal inference, GLMs and survival analysis.

Eight end-to-end projects. Each has a brief, a dataset, milestones, a grading rubric and a reference solution.

  1. Python CLI report tool
  2. Sales analysis
  3. House price regression
  4. Customer churn classification
  5. Customer segmentation
  6. Demand forecasting
  7. Review sentiment
  8. Deployment

A learning path is an ordered list of modules for one goal. Pick the path that fits you and follow it from top to bottom. If you are not sure, do the whole course in order: it covers all three paths. Everyone starts with Start here.

Python developer. You want to write general-purpose Python: scripts, automation, tools, back-end code and tested libraries.

  1. Python basics · module 01
  2. Strings and text · module 02
  3. Control flow · module 03
  4. Data structures · module 04
  5. Functions · module 05
  6. Errors and debugging · module 06
  7. Files and data formats · module 07
  8. Modules, packages and environments · module 08
  9. Standard library power tools · module 09
  10. Iterators and generators · module 10
  11. Decorators and context managers · module 11
  12. Type hints · module 12
  13. Pythonic code · module 13
  14. Testing with pytest · module 14
  15. Performance and concurrency · module 15
  16. APIs and web data · module 16
  17. Algorithms and data structures · module 17
  18. Classes and objects · module 18
  19. Inheritance and polymorphism · module 19
  20. The Python data model · module 20
  21. Dataclasses, enums and slots · module 21
  22. Design principles and patterns · module 22
  23. SQL for data analysis · module 30

Do the checkpoints of Parts 1, 2 and 3. Then build this capstone:

Each path is a minimum. You can add any other module at any time; the prerequisites at the top of each lesson tell you what it assumes. To learn how to work through a module, read How to study.