The course aims at reproducible code: code that another person can run a year later and obtain the same result.
The next slide gives the full schedule.
Noel Jeffrey Pinton · Department of Computer Science
The first month covers the language itself and is the most demanding. Later weeks mostly cover libraries — bundles of ready-made code written by others and loaded into a new program — which are easier to learn than the language.
Most names on this slide (NumPy, pandas, SQL, Git…) are tools introduced later. No prior knowledge of them is assumed; each is explained in the week it is introduced.
Setting up Python, then types, control flow, functions, data structures and files. Week 4 moves beyond single scripts: objects, errors and project organisation.
NumPy for arrays, then two weeks of pandas: grouping, merging and reshaping. Then matplotlib and seaborn for presenting results as figures.
Reading from files, SQL and APIs. Regular expressions for irregular text. Then Git, environments and debugging, which support the Week 12 project.
One project that uses most of the above, followed by a presentation.
The course does not train software engineers. It teaches code as the next tool when an analysis exceeds what a spreadsheet can handle.
A script — a file of code, the written instructions a computer carries out — records exactly what was done. The record does not change over time.
The work is the same whether the file has a hundred rows or a million.
Another person can read the analysis and identify any errors in it.
Each of the four objectives below can be assessed directly.
Determine what an unfamiliar script does. In practice, reading code is more frequent than writing it from scratch.
Load, filter, group, join and reshape a real dataset in pandas, instead of editing a spreadsheet by hand.
A figure whose chart type and labels are chosen to support a specific claim, rather than left at their defaults.
A project with pinned dependencies and a README that runs on another person’s machine.
Classes meet on Saturdays for three contact hours. All other study is self-scheduled.
Slides for every week remain here permanently. All important content is written down, so a missed session can be made up.
Working through difficulty is part of learning, but working alone on one problem for days is not. After 30 minutes without progress, students should ask for help.
All weekly decks share one layout, so any week can be studied independently and at any pace.
Arrow keys or space bar (or the ‹ › buttons at the top). F toggles full screen. The bar at the bottom shows progress through the deck.
A new term is explained on the slide where it first appears. Each week opens with a Key terms slide and ends with a glossary of all the new terms.
An answer is chosen first; clicking and holding (or tapping) the question then shows the answer and its explanation. Incorrect guesses are not graded and aid retention.
A dark slide either starts a new part, stating how it connects to earlier material, or marks a suitable place to pause.
Each deck is used like a textbook chapter: read, predict, reveal, and pause at the dark slides.
From Week 2 onward, Python runs inside the slides and the labs with no installation. Python is downloaded into the web browser on first use.
____ (four underscores) in the code with an answer.The slides present an idea, the Run button allows experimentation with it, and the lab applies it. A red error message in either place is normal: read its last line, change the code, and run it again.
There are no prerequisites beyond graduate standing. Types and control flow are introduced from first principles in Week 2.
The course is designed for this group. No prior use of a terminal (a window for typing commands instead of clicking) is assumed.
The new material is the data stack — the set of libraries data scientists use together: NumPy, pandas, matplotlib — and the practices that make analysis reproducible.
Programming is learned through practice; observation alone is not sufficient.
Retyping examples, including parts that seem familiar, reveals details that reading alone misses.
Changing a line, predicting the result and then running it tests understanding. An incorrect prediction identifies a gap.
A traceback is the error report Python prints when a line fails. It names the file and the line, and its last line states what went wrong. That line usually contains the information needed for the fix.
The Week 12 project requires more than one week of work, so an early start is recommended.
A browser-based setup requires no installation and behaves the same on every machine.
Colab (colab.research.google.com) is Google’s free notebook website. Sign-in requires a Google account.
Create a new notebook, type print("hello") and press Shift+Enter. This completes the setup.
For a local setup, Anaconda can also be installed, but Colab alone is sufficient.
print("hello")Memorisation is not required at this stage; Week 1 explains each term again, with examples.
Written instructions, in a programming language, that the computer carries out exactly.
e.g. print("hello") is one line of code
The programming language this course uses, widely adopted because its syntax resembles English.
e.g. 1 + 1 is valid Python; it gives 2
A document of boxes that mix text and runnable code. Colab and Jupyter show notebooks.
e.g. the file opened in Colab on the previous slide
One box in a notebook. Shift+Enter runs it; its result appears underneath.
e.g. a cell containing 1 + 1 shows 2 below it
A bundle of ready-made code written by others and loaded into a new program.
e.g. pandas, a library for tables
A name that holds a value. Analogy: a labelled box containing that value.
e.g. price = 100 puts 100 in a box labelled price
Python’s report that it could not carry out a line. Errors are normal and fixable.
e.g. misspelling a name gives a NameError
The report Python prints with an error. Read its last line first: it says what went wrong.
e.g. NameError: name 'pirce' is not defined
Week 1 covers the limits of spreadsheets, the role of each main library, and how to read error messages, which appear frequently throughout the semester.
Week 1 slides are available on the course page for advance reading.