Six short functions on the farm survey, each with one mistake that makes a table say something untrue: area codes that lose their leading zero, a filter written with and instead of &, a comparison with a missing value, an assignment that never reaches the table, numbers read as text, and values that land on the wrong rows. Each check starts red: that is the point.
For each one you predict what the code gives, run it, trace the line that makes the difference, fix it, and say in one sentence what the mistake was. The last one raises no error at all; only its check finds it. The companion has each fix and why it works.
What you do
Section titled “What you do”- A table that lies: six bugs to find and fix
Its notebooks
Section titled “Its notebooks”- 25_debugging_drill.pyDebugging drill: a table that liesRead itCompanion · 6 exercises
The notebooks are in your course folder; here you can read them without running anything. For reference in any module: primer: marimo and the python this course assumes and primer: pandas 2 to 3 and glossary.