Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

SC 3.8: Tidying messy data in five steps

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

50 minutes

An export nobody can use

The help desk system exports a file. One line says "12; High ;a4". The next says "13;HIGH;A4 ". Another says "14;urgent;a5".

The same priority is spelt three ways, and one word is not in the list. Before anybody can report on this, somebody must tidy it. That job has five steps.

By the end of this lesson

Note

I can put the five steps for tidying messy data in order and say what each does.

Key words

WordWhat it meansExample
Data wranglingTurning messy raw data into data that is ready to use.Tidying a help desk export
StructureTo put data into fields and rows.Split a line at each semicolon
CleanTo fix or remove wrong, odd or repeated values.High and HIGH become high
ValidateTo check that data is sensible and allowed.Priority must be low, medium or high
EnrichTo add useful extra data from somewhere else.Add the hours allowed to reply
OutputTo save or show the finished data.A report line

The cells students fill in are left blank in this preview.

Starter: what you already know

Have a go

Starter: what you already know

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Wrangling makes raw data ready

Data wrangling turns messy raw data into data that is ready to use. Use it when data comes from many places, or in different shapes, or with mistakes.

It is not one job. It is five steps, done in a set order.

What each step does

  1. Structure. Put the data in fields and rows.
  2. Clean. Fix spaces, capitals, repeats and gaps.
  3. Validate. Check each value is allowed. Flag or remove the rest.
  4. Enrich. Add useful facts, such as how many hours a reply is allowed.
  5. Output. Save or show the finished data in the form people need.

Worked example: one messy line

StepWhat we haveWhat happened
Raw line13;HIGH;A4 Messy export
Structure13 | HIGH | A4 Three fields
Clean13 | high | a4Spaces and capitals fixed
Validatehigh is allowedPasses the check
Enrichhigh: reply in 4 hoursExtra fact added
Output13: high (reply in 4 hours)Ready for a report

The cells students fill in are left blank in this preview.

The lesson goes on

5 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.