A statistical table starts as codes. This module turns them into categories: education groups from the code list with a mapping table, a member’s role in fishing from four flags with np.select, age groups with pd.cut, and the top eight species with the rest as Other, keeping blanks and codes out of range visible rather than lost.
Then it counts distinct operators, fishing units and households at national, regional and provincial levels, in pandas and polars, and builds the tabulation frame, one row per unit with its classifications and its design columns, that module 6 estimates from.
What you do
Section titled “What you do”- Categories from codes: mapping tables, np.select, pd.cut, top-N with other
- Distinct counts by group at national, regional and provincial levels
- The tabulation frame an estimate is computed from
The module’s notebooks
Section titled “The module’s notebooks”- 40_recode_and_tabulate.pyRecode and tabulateRead itCompanion · 7 exercises
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 “Recode and tabulate”, and how ready you feel; its answers show as soon as you submit.Check-in: Recode and tabulate ↗
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.