Anonymising data

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Anonymising data

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which is a good way to anonymise a class survey?
A Remove the Name column before sharing
B Keep the Name column but make the text smaller
2. Which one replaces a student's name with an ID number?
A Mia scored 8 out of 10
B Student 12 scored 8 out of 10
3. Anonymised data means...
A People in the data cannot be recognised
B The data has been deleted completely
4. Which way of showing ages is better for keeping people anonymous?
A Age groups like 10-11 and 12-13
B Exact birthdays like 4 May 2013
5. A table has no names, but it lists 'Year 6 student who lives at 5 Wattle St'. What is the problem?
A There is no problem because the names are gone
B The address is a hidden identifier that could show who it is

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Student ID: S01 AA grouped age that hides the exact age so a person is harder to identify
2Age group: 10-11 BAn ID number used in place of a student's name so the person cannot be recognised
3Anonymise a table by removing the column that shows who each person is CCheck: street, birthday, class
4Check for hidden identifiers that could still show who someone is, like a rare detail DThe ID still contains the person's name, so Mia can still be recognised. Use a random ID like S01 instead.
5Name column removed, but Street: 5 Oak Rd is still in the table EA hidden identifier is left in. The address can still show who the person is, so the data is not anonymous.
6Name: Mia Lee changed to ID: Mia1 FDelete column: Name

Definitions

anonymise

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
_________(survey_data)
2.
_____________(survey_data, "Name")
3.
_______________(survey_data, "Name")
4.
if age __ 10 and age <= 11: age_group = "10-11"
5.
___ column in survey_data: check_hidden_identifiers(column)

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A data = load("survey.csv")
B remove_column(data, "Name")
C add_ids(data)
D keep_column(data, "Address")
E save(data, "safe.csv")
Question 2
A ADD "Name" TO table
B FOR EACH row IN table
C SET row.id TO next_number()
Question 3
A if age == 11:
B group = "10-12"
C else:
D group = "other"
Question 4
A names = ["Mia", "Leo", "Zoe"]
B ids = []
C for i in range(len(names)):
D ids.append(names[i])
E print(ids)
Question 5
A hidden = ["Phone", "Email"]
B for col in hidden:
C remove(data, hidden)
D print("Checked")

Answer Key

Anonymising data
Section A: Quick Questions
Q1
A — Remove the Name column before sharing
Q2
B — Student 12 scored 8 out of 10
Q3
A — People in the data cannot be recognised
Q4
A — Age groups like 10-11 and 12-13
Q5
B — The address is a hidden identifier that could show who it is
Section B: Match the Pairs
Q1
Student ID: S01 → An ID number used in place of a student's name so the person cannot be recognised
Q2
Age group: 10-11 → A grouped age that hides the exact age so a person is harder to identify
Q3
Anonymise a table by removing the column that shows who each person is → Delete column: Name
Q4
Check for hidden identifiers that could still show who someone is, like a rare detail → Check: street, birthday, class
Q5
Name column removed, but Street: 5 Oak Rd is still in the table → A hidden identifier is left in. The address can still show who the person is, so the data is not anonymous.
Q6
Name: Mia Lee changed to ID: Mia1 → The ID still contains the person's name, so Mia can still be recognised. Use a random ID like S01 instead.
Section C: Definitions
Q1
anonymise — To remove or replace names and other identifying details in data, like using ID numbers, so people cannot be recognised.
Section D: Fill in the Blanks
Q1
anonymise(survey_data)
Q2
remove_column(survey_data, "Name")
Q3
replace_with_id(survey_data, "Name")
Q4
if age >= 10 and age <= 11: age_group = "10-11"
Q5
for column in survey_data: check_hidden_identifiers(column)
Section E: Spot the Error
Q1
D — An address can identify a person, so it must be removed, not kept. The line should be remove_column(data, "Address").
Q2
A — To anonymise data you take names out, not add them. The line should be REMOVE "Name" FROM table.
Q3
A — Grouping ages means using a range, like 10 to 12. Checking one exact age does not group people, so they could still be recognised. It should be if age >= 10 and age <= 12:
Q4
D — This adds each person's name to the ID list, so the names are still there. It should add an ID number: ids.append(i + 1).
Q5
C — The loop should remove one column at a time using the loop variable col. It should be remove(data, col).