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

Free lesson

6.2: Changing data: manipulate, analyse, process

The whole lesson, free. Read it and have a go at the activities. To work the tasks and labs in the real lesson, press Start lab, with no account needed.

40 minutes

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

The school trip list

Your class plans a trip. Ms Okafor has a messy list: names in any order, some prices, some students who have not paid.

She needs three things. A tidy list. The total cost. How many students have paid.

She does not collect new data. She changes the data she has. That is transforming data.

Key words

WordWhat it meansExample
TransformTo change data so it is more useful.Sort a list by price
ManipulateTo change the shape or order of data.Keep only students who paid
AnalyseTo look at data to find out what it says.Find the average price
ProcessTo take input, do a set of steps and give output.Turn a list of prices into one total
AverageThe total divided by how many items there are.60 divided by 3 is 20
PercentageA number out of every 100.75 out of every 100
FilterTo keep only the rows that fit a rule.Prices under £15
SortTo put items in an order.Smallest price first

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

Three ways to transform data

A box, "Messy list", has an arrow to each of three boxes, "Manipulate: sort and filter", "Analyse: total, average, percentage" and "Process: steps from input to output", and each of those has an arrow to "A useful answer".A box, "Messy list", has an arrow to each of three boxes, "Manipulate: sort and filter", "Analyse: total, average, percentage" and "Process: steps from input to output", and each of those has an arrow to "A useful answer".

Try it: manipulate a list

Code: python
prices = [12.5, 5.0, 20.0, 8.0, 15.0]

print("Original:", prices)
prices.sort()
print("Sorted:", prices)

cheap = []
for price in prices:
    if price < 15:
        cheap.append(price)
print("Under 15:", cheap)

# Change 15 to 10 and run it again.

Make a free account to save your work and track your progress.

Manipulating: change the shape

Manipulating data means changing how it looks or where it sits. You do not find out anything new.

You can sort a list. You can filter it to keep only some rows. You can join two lists into one, or change "5" typed as text into the number 5. The facts stay the same.

Analysing: find out what it says

Analysing means looking at data to learn something new. You count, add up, and compare.

The total of the prices is one answer. The average is another. The percentage of students who paid is a third. Analysis turns many numbers into a few useful ones.

Worked example: total and average

StepWhat you doResult
1Write the prices10, 20, 30
2Add them up10 + 20 + 30 = 60
3Count them3 prices
4Divide the total by the count60 divided by 3 = 20
AnswerThe average price£20

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

Quick check: which way?

Have a go

Quick check: which way?

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

Worked example: a percentage

StepWhat you doResult
1Count the students who paid15
2Count all the students20
3Divide paid by all15 divided by 20 = 0.75
4Multiply by 1000.75 times 100 = 75
Another way20 goes into 100 five times, so multiply both numbers by 515 times 5 = 75 and 20 times 5 = 100
AnswerA percentage is out of every 10075 out of every 100 have paid

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

Processing: from input to output

Processing is a set of steps that takes input and gives output.

Input: a list of 30 prices. Steps: add them up, divide by 30. Output: one average. A program does this fast, and it can do the same steps for a million prices.

Match the job to the way

Have a go

Loading…

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

Your turn: the trip sums

Help Ms Okafor with the trip. Fill in four functions. One adds up the prices. One finds the average. One finds the percentage of students who paid. One keeps the prices below a limit and puts them in order. Press Run Tests to check.

Code: python
def total_cost(costs):
    # costs is a list of prices in pounds. Give back the total.
    return None


def average_cost(costs):
    # Give back the total divided by how many prices there are.
    return None


def percent_paid(paid, students):
    # How many out of every 100 students have paid?
    # Divide paid by students, then multiply by 100.
    return None


def cheap_sorted(costs, limit):
    # Keep only the prices below the limit, smallest first.
    return None

Make a free account to save your work, or press Start lab to work through the whole lesson.

Draw the process

The diagram shows how a program processes the trip money. Edit it in two steps.

  1. Add a box between the "Add them up" box and the output box. Write: divide by how many prices there are. Change the output box to say: the average price.
  2. Add one more input box of your own, such as the coach price.
flowchart LR
  input[Input: the trip prices] --> add[Add them up]
  add --> output([Output: the total])

Make a free account to save your work, or press Start lab to work through the whole lesson.

Key words crossword

Have a go

Loading…

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

Watch: the trip list, changed three ways

Press Play on the short film below. It follows Ms Okafor's trip list through the three ways to change data. Listen for the myth about sorting.

Film: Changing data

Changing data: manipulate, analyse, process

Every scene, as text

  1. The school trip list. Ms Okafor has a messy list (messy: names in any order, some not paid). A tidy list. The total cost. How many students have paid. She changes the data she has (that is: transforming data).
  2. Three ways to transform data. Messy list. Manipulate: sort and filter. Analyse: total, average, percentage. Process: steps from input to output. A useful answer.
  3. Manipulating: change the shape. [12.5, 5.0, 20.0, 8.0, 15.0] (list: the prices as they start). [5.0, 8.0, 12.5, 15.0, 20.0] (sort: smallest price first). [5.0, 8.0, 12.5] (filter: keep only prices under 15). The facts stay the same.
  4. Myth (false): sorting is analysing. [12.5, 5.0, 20.0, 8.0, 15.0]. [5.0, 8.0, 12.5, 15.0, 20.0] (sort: the same five prices, a new order). That is not true: sorting changes the order. You do not find out anything new. Analysing finds out something new (example: the average price, £20).
  5. Analysing: find out what it says. 10 + 20 + 30 = 60 (total: every price added). 60 ÷ 3 = 20 (average: the total divided by the count). 15 ÷ 20 = 0.75 (divide: paid by all students (15 of 20)). 0.75 × 100 = 75 (percentage: a number out of every 100).
  6. Processing: from input to output. Input: every order. Step: add the tax. Output: print the bill. A program runs the same steps on many records (example: all 500 students at night).

Final check

Have a go

Final check

6 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

Remember

Tip

Manipulate: change the order or shape. Analyse: find out something new. Process: input, steps, output. Real work uses all three.

Teach this lesson with your class

On a college account your students work the tasks and the labs as well, and every mark is kept for you.