Skip to content
Learn Python with BNHR

Module 5 · Beginner

Cleaning and time

Module 5 of Arrays & DataFrames: missing values and not-stated codes, the right types and one unit, dates read day-first, an introduction to time series, and checks you can rerun. Its sections, its notebooks to read on the web, and the companion's solutions and explanations.

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

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.

  1. Missing values: NaN, NA, not-stated codes
  2. Types: nullable integers, category, text with .str, one unit
  3. Dates: parsing day-first, periods
  4. An introduction to time series: farmgate prices by month, a date index, resample, rolling, shift and growth
  5. Duplicates, and checks you can rerun

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.

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 stretch exercises
Stretch exercises S3Stretch: charts
AboutStretch exercises of Arrays & DataFrames, after module 7: chart exercises on the survey and the prices, in the library of your choice, each with its check and its solution on the companion.
CourseArrays & DataFrames, free