Episode 9: The Pitch Deck
Programming with Python · Tutorial 09
The pitch meeting is Friday, and the investor gave one instruction: “Bring me charts I can’t argue with.” Last week you turned the data room into numbers she could trust; this week those numbers have to be seen. Same file, orders_messy.csv, now with pictures: you pick the chart that fits each question, save it as a picture file, and end the lab with a deck of six. Tobi has already “built the deck”: two slides and one argument for a new rider. Your job is to supervise: catch the chart she can argue with before she does.
Run the lab on your laptop
The lab is a Python script again. It runs in the python-labs folder, next to last week’s files.
Download the script and move it into your
python-labsfolder.orders_messy.csvis still there from last week; if not, download it again:In Zed, open the
python-labsfolder, then the terminal (Ctrl+`).Run
uv run python lab_09_pitch.py.
Use a GitHub codespace: a Linux computer that runs in a browser tab.
Sign in at github.com/codespaces and open last week’s codespace again. If you have none, start the Blank template and follow the uv guide (the macOS or Linux lines) in its terminal, down to
uv add pandas matplotlib.Go into the folder with
cd python-labsand download the script. The second line is only needed in a new codespace:curl -O https://python.tobiasvlcek.com/labs/lab_09_pitch.py curl -O https://python.tobiasvlcek.com/labs/orders_messy.csvRun
uv run python lab_09_pitch.py.
To look at a chart, click its PNG file in the file list on the left. A codespace has no Zed, so keep the chatbot open in a second tab for AI help.
The first run stops with AssertionError: Task 1: not attempted yet., as it did last week: the script checks every task and stops at the first one you have not solved yet. The very first run can take a little longer, because matplotlib sets up its fonts once.
If the run ends in ModuleNotFoundError instead, the terminal is not inside python-labs, or the packages are missing. In that folder, run uv add pandas matplotlib once.
A script has no cell that could show a chart, so every chart goes into a picture file in python-labs. Task 2 in the script shows the three lines that end every chart. To look at a picture, click its file in Zed’s project panel, the file list on the left.
The checks only test the form of a chart: that it has a title, that its bars add up to your own numbers. They cannot see whether the chart tells the truth. And two things in Tobi’s deck are wrong without any task saying so: one is in his numbers, one is in what he claims. No check catches either of them.
When every check passes, the script puts your six charts side by side into pitch_deck.png and prints a block that starts with SHOW THIS IN CLASS. Show both to your lecturer. As in lab 08, that is feedback, not a condition for leaving, and a lab you finish at home does not have to be shown later.
Checkpoint 5 next week is still handed in from the browser, and the script labs no longer practise that. So take two minutes before you go: open today’s last exercise, ex_09_e, press Cmd/Ctrl+S, then menu → Download → Download Python code, and find the file in your Downloads folder.