Skip to content
Learn Python with BNHR

Debugging drill D1 · Intermediate

Debugging drill: a flat table that lies

Debugging drill D1 of Python for Survey Statistics, after module 4: six bugs in building a flat table from the regional databases, to predict, trace, fix and explain.

Extra D1Level Intermediate
On this page
  1. Overview
  2. What you do
  3. Its notebooks
  4. Certification and support

Six short pieces of pipeline on the survey, each with one mistake that makes the flat table say something untrue: an area code that loses its leading zero, a join that multiplies rows, a deletion filter negated halfway, the export’s null token read as text, codes compared as numbers against text, and a stray second download attached as a region. 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. Two of them raise an error; the other four return a wrong table without one, and only the check finds them. The companion has each fix and why it works.

  1. A flat table that lies: six bugs to find and fix

The notebooks are in your course folder; here you can read them without running anything. For reference in any module: primer: from r to python and primer: survey sampling in one page and glossary.

Saved in this browser only

Certification and support

We offer additional resources, certificates, ongoing support, and other perks to those who join our instructor-led training.

Join an upcoming training to take this as an instructor-led course, or contact us to arrange one for your team or organization.

Something new

Identify results
LayerExplore a module
ModuleAnomalies by rule and by statistics
AboutModule 8 of Python for Survey Statistics: invalid, implausible and unusual values, outliers within groups with IQR, robust z and Hidiroglou-Berthelot, interviewer indicators, and one ranked review table. Its sections, its notebooks to read on the web, and the companion's solutions and explanations.
CoursePython for Survey Statistics, free