Real data arrives with gaps, codes for “not stated”, plots measured in two units, dates written day-first and rows entered twice. This module cleans each of them in the survey, deciding when a gap should stay a gap. It then turns to monthly farmgate prices for a first look at time series: a date index, quarterly averages, rolling means and growth rates, with a month whose file never arrived made visible instead of quietly skipped.
What you do
Section titled “What you do”- Missing values: NaN, NA, not-stated codes
- Types: nullable integers, category, text with .str, one unit
- Dates: parsing day-first, periods
- An introduction to time series: farmgate prices by month, a date index, resample, rolling, shift and growth
- Duplicates, and checks you can rerun
The module’s notebooks
Section titled “The module’s notebooks”- 40_cleaning_and_time.pyCleaning and timeRead itCompanion · 10 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.