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

Preview

DA 1.13: Why quality matters and how to cleanse

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

55 minutes

A decision built on sand

A club counts its members from a table. The table counts Sam twice and ignores everyone with a blank age. The club thinks it has 40 members. It has 31.

It orders too many snacks and charges the wrong fee. Poor quality data leads to poor decisions.

Key words

WordWhat it meansExample
CleansingFixing or removing poor data so it can be trusted.Deleting a repeated row
BiasA leaning that makes results unfair or untrue for some groups.Only asking people who are in a good mood
RemoveTo take out rows or values that should not be there.Duplicates, old data, outliers
EditTo correct a value.Fix the typo Brwn to Brown
ParseTo read text and split it into a form a program can use."Sam:15" into a name and an age
ConfidenceHow far you can trust the data.High after checking
TypoA small typing mistake.Brwn

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

By the end of this lesson

Note

I can say why fixing quality matters, and use remove, edit and parse to build confidence in data.

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.

Two reasons quality matters

First, clean data gives accurate and meaningful results. A wrong count gives a wrong decision.

Second, it helps you avoid bias in how data is managed. If you keep only the easy rows, the data speaks for some people and not for others. Fair results need fair data.

Three ways to cleanse

ActionWhat it doesExample
RemoveTakes out what should not be thereDuplicates, out-of-date rows, outliers
EditCorrects errorsFix a typo
ParseReads text into fieldsSplit "Sam:15" into name and age

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

Try it: remove, edit, parse

Code: python
names = ["Sam", "Jo", "Sam"]
unique = []
for name in names:
    if name not in unique:
        unique.append(name)
print("Removed repeats:", unique)

pair = "Sam:15".split(":")
print("Parsed:", pair[0], int(pair[1]) + 1)

# Try it: add "Jo" to the end of names and press Run.

A common mistake

Warning

Many people delete an outlier just because it is large. A big value may be real. One very big order could be a real customer. Check it first. Remove it only if it is an error.

The lesson goes on

2 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.