Python for Data Science
Four levels, twelve lessons, from an array to a pipeline
Python is the language data science actually runs on, and the reason is not the language itself - it is NumPy, pandas, scikit-learn and the hundred libraries built on top of them. Learning Python for data work means learning that stack and the way of thinking it rewards.
Overview
This is the foundation of the rest of the Data Science track. Analytics, machine learning, deep learning and generative AI all assume you can load a messy file, clean it, reshape it and look at it without reaching for a spreadsheet - which is exactly what the twelve lessons here are about.
Introduction
This course assumes you can already write Python: functions, loops, lists and dictionaries. If you cannot, take Python: From Basics to Expert first - it is on this site, it is free, and Level 1 and 2 of it are all you need before coming back here.
Every level is three lessons and a Level Check quiz, with an Expert Exam at the end. The examples use small datasets written into the code rather than files you have to download, so every one of them runs as it stands.
By the end you will be able to take a file somebody sends you, work out what is wrong with it, reshape it into the form your question needs, answer that question, and hand the whole thing to a colleague in a state where it runs for them too.
What you will be able to do
- Replace loops with vectorised array operations, and know why that matters
- Load data from CSV, JSON, SQL and Excel, including the broken ones
- Find and fix missing values, wrong dtypes and duplicate rows
- Group, join and reshape a DataFrame to answer a specific question
- Work with dates and time zones without silently shifting your data
- Make an analysis somebody else can run and get the same numbers
What each level covers
4 levels · 16 lessons
-
Level 1 - Basic
The scientific stack, and the two objects the rest of data work in Python is built from. The NumPy array comes first because pandas is built on it: one typed block of memory that you operate on as a whole rather than one item at a time. Then the DataFrame, which is what you will actually hold data in - a set of named, typed columns sharing an index.
4 lessons 40 min of reading
Start with The Scientific Stack and Where to Run It → -
Level 2 - Intermediate
Real data arrives broken. This level is about getting it in - from CSV, JSON, SQL and Excel, including the files with the wrong encoding and the header three rows down - and then about the cleaning that always follows: missing values that are not always NaN, numbers that arrived as strings, and duplicates that are only duplicates on some columns.
4 lessons 47 min of reading
Start with Reading Real Data: CSV, JSON, SQL and Excel → -
Level 3 - Advanced
The analysis itself. Group-by goes beyond one aggregate per group into transforms and window calculations; dates turn out to be the part of data work most likely to be quietly wrong, especially across time zones; and plotting is treated as a way of finding out what is in the data rather than as the last step before a slide.
4 lessons 47 min of reading
Start with Group-By in Depth and Window Calculations → -
Level 4 - Expert
The difference between an analysis that ran once on your laptop and one somebody else can run next quarter and get the same numbers. Memory and dtypes, because the first serious dataset will not fit; reproducibility, because a notebook that only runs in the order you happened to press the keys is not a result; and the move from a notebook to something that runs on a schedule.
4 lessons 1 hr of reading
Start with Memory, dtypes and When Pandas Is Wrong →
Guides and articles
Longer reading about this subject, written alongside the course.
Before you start
- Python basics: functions, loops, lists and dictionaries
- No statistics or maths beyond arithmetic
Common questions
- What does the Python for Data Science course cover?
- It is 4 levels and 16 lessons: Level 1 - Basic; Level 2 - Intermediate; Level 3 - Advanced; Level 4 - Expert. Each level ends with a quiz, and the last one is an exam over the whole course.
- How long does it take?
- About 194 minutes of reading and exercises - roughly 3.2 hours. It is self-paced with no cohort and no start date, so you can leave and come back and the site remembers where you were.
- What do I need to know first?
- Python basics: functions, loops, lists and dictionaries. No statistics or maths beyond arithmetic.
- Is it free?
- Yes. Every lesson, example and quiz in this course is free to read, and you do not need an account to read them. Signing in only adds progress tracking and quiz results.
- What will I be able to do afterwards?
- Replace loops with vectorised array operations, and know why that matters. Load data from CSV, JSON, SQL and Excel, including the broken ones. Find and fix missing values, wrong dtypes and duplicate rows. Group, join and reshape a DataFrame to answer a specific question. Work with dates and time zones without silently shifting your data. Make an analysis somebody else can run and get the same numbers.