Skip to content
Learn Python with BNHR

Module 3 · Intermediate

Match the keys

Module 3 of Python for Survey Statistics: matching the keys between tables: orphans in every child table, operators against the members roster, the automated and the manual repair, and edits written back with an audit flag. Its sections, its notebooks to read on the web, and the companion's solutions and explanations.

Module 3Level Intermediate
On this page
  1. Overview
  2. What you do
  3. The module’s notebooks
  4. Quizzes
  5. Certification and support

This module matches the keys between a survey’s tables, start to finish. It first finds the orphans in every child table: each one against its fishing units by its own prefixed key parts, crew included, and the operators named on the units against the members roster, from both sides. Then it takes the catch table in depth: anti-joins both ways, the leftovers paired within a household, each pair labeled in words and the key part that differs found.

Then it decides: where a household’s only stray key meets its only unit without catch, or a stray key is one part away from exactly one unit, a rule can repair it; where it is one part away from two units, or both parts differ, a person decides. The automated edits are written back to a copy of the database in one transaction with an audit flag, shown first as a dry run, and a second run changes nothing.

  1. Orphans across the tables: every child table by its prefix, operators by their roster line
  2. Orphan rows both ways: anti-joins, semi-joins, merge's indicator
  3. Keys of several parts: which part differs
  4. The automated case and the manual case
  5. Edits written back in a transaction with an audit flag

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.

Quizzes

  • Check-inAt the end of the module. A short check on “Match the keys”, and how ready you feel; its answers show as soon as you submit.Check-in: Match the keys ↗

The quizzes are on BNHR Quizzes and count toward nothing. Learning on your own, a quiz opens as the self-paced one; while a training runs, it asks which training you are in.

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
ModuleFunctions
AboutModule 5 of Python Essentials: parameters, return values and defaults, scope, sorting with a key, lambda, map and filter, and reading a class. Its sections, its notebooks to read on the web, and the companion's solutions and explanations.
CoursePython Essentials, free