Data Cleaning Exercises

Guide · updated 2026-11-04

Pivot and unpivot without inventing data

Reshaping tables while keeping zeros, gaps and collisions honest.

Pivot

Declare the output columns. Cells that were never reported stay missing; they are not 0. Two values for the same cell are a collision: aggregate by a declared rule or reject.

Unpivot

Turning wide columns into rows creates rows for unanswered questions. Drop them or keep them as missing; never invent a score.

Check the shape

After reshaping, count rows and compare totals with the source.

Practise it