Skip to content
  • Home
  • How To
  • M0
  • M1
  • Agents
  • Module 2 - Data
  • M3
  • M4
  • M5
  • M6
  • Progress
  • Contact
  • Pricing
  • Sign in
  • Future
  1. Module 2M2
  2. ›
    S6Transformation and Aggregation
  3. ›
    Intro
  4. ›
    S6›Intro
  1. Module 2
  2. ›
  3. Section 6

Section 2.6: Transformation and Aggregation

A clean table is still not the table a model learns from. This section covers turning columns into features, element by element and across rows, summarizing groups and reshaping a table between long and wide, and combining tables by stacking them or joining a lookup onto them.

Section 2.5 fixed what was wrong inside each column. The features a model needs, here a model that predicts how long a listing stays on the market, are mostly built from several columns or several rows at once: a price against its neighborhood's average, a listing's distance to the center from a lookup table. Each of those steps can return a table that looks right and holds the wrong number of rows or the wrong values, so each lesson reconciles its counts before and after.

Lessons

  1. Apply and Element-wise Transformation - vectorized features first, then map, apply and binning.
  2. GroupBy, Aggregation, the MultiIndex and Reshaping - statistics per group, group-relative features, two-level indexes and grids.
  3. Combining Datasets - Concat and Merge - stacking tables, and joining a lookup without multiplying rows.

By the end you will be able to:

  • Build features with vectorized expressions, and reach for apply only where none exists.
  • Summarize groups with named aggregation, and build group-relative features with transform.
  • Reshape a table between long rows and a grid, and tell an empty cell from a zero.
  • Merge a lookup table onto a dataset, and guard the merge so a duplicated key cannot multiply rows.
Your progress
Current streak
🔥 0
Lessons marked today
0 / 3
Longest streak
0

Sign in

The bootcamp

  • Curriculum
  • How To
  • Pricing
  • Changelog
  • Future

The community

  • Discord
  • Reviews
  • Contact

Follow

  • Instagram
  • X
  • TikTok
  • Reddit

Legal

  • Terms
  • Privacy
  • Refunds

Coming soon on November 16, 2026

The AI/ML Newsletter, free.

SubscribeComing soon on December 1, 2026

Confirm by email, unsubscribe in one click.

Theme