The questions people ask of a survey are about groups: the yield of rice in each province, each crop’s share of the land, how many farm households the survey stands for. This module answers them with groupby, then with survey weights, and shows how far an unweighted mean can be from the right answer. It reshapes tables between long and wide, and joins the survey to PSA’s code list on the code, never the name, checking that no row is lost or doubled.
What you do
Section titled “What you do”- Group and aggregate
- Within groups: transform, shares, ranks, running totals
- Survey weights: weighted means, totals and shares
- Tidy data: pivot, melt, crosstab
- Joins and concatenation: keys, validate=, indicator=
The module’s notebooks
Section titled “The module’s notebooks”- 30_summarize_and_combine.pySummarize and combineRead itCompanion · 11 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.