Skip to the workspace
Pebellslearn by building
Data Cleanup  ›  Capstone Project

Data Transformation

Data Transformation 14 minTransformation reshapes values into a consistent, comparable form, by fixing formats and units, deriving new columns, and rescaling numbers.

data analyst / Data Transformation

Explore each scene at your own pace.

01 · The rule

The rule

Data Transformation

Kettle & Crumb opens a second branch, and its till exports data its own way: dates like 03/06/2025 stored as text, prices in paise, and a column called Qty Sold. You cannot stack the two tables, compare the branches, or chart them together until they speak the same language. Transformation is the step that makes values consistent and comparable.

The rule

Same meaning, same form: standardise, derive, then rescale.

1. Standardise so that equal things look equal:

  • Types: text that looks like a date or number becomes a real date or number.
  • Formats: one date format (2025-06-03), one spelling for categories (Cold coffee, not cold coffee and Cold Coffee).
  • Units: one currency and scale. 12,000 paise ÷ 100 = ₹120.
  • Names: matching column names, such as qty in both tables.

2. Derive new columns from existing ones:

  • weekday from order_date, to compare weekends with weekdays.
  • revenue = qty × price.
  • Bins: turning a number into bands, like order size Small / Medium / Large.
  • branch, added before stacking two tables, so each row keeps its origin.

3. Rescale when numbers on different scales must be compared:

  • Min-max scaling squeezes a column into 0 to 1: (x − min) ÷ (max − min).
  • z-scores say how many standard deviations a value is from the mean: (x − mean) ÷ standard deviation. For the week's sales (mean 48, standard deviation 21), a day of 69 cups has z = 1.
  • Aggregation, such as daily rows summed to weekly totals, is also a transformation: it changes the level of detail.
Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.