Kinds of data
Blanks: when a value is missing
A blank cell means we do not know the answer; zero means we know the answer is none, and the two must never be mixed up.
By the end of this lesson you can find blank cells and explain why a blank is not the same as zero.
Why it matters
A health worker records how many times each child has been vaccinated. A child with "0" needs help now. A child with a blank might be fully protected; nobody wrote it down. Treat the blank as a zero, and you send nurses to the wrong homes.
The idea in plain words
Imagine you ask a friend, "How many brothers and sisters do you have?"
- If they say "none", you know the answer: 0.
- If they walk away without answering, you do not know. They might have none. They might have five.
A table needs a way to show both. A zero means "we know: none". An empty cell, a blank, means "we do not know".
Blank (missing value): a cell with nothing in it, because the answer was not given or not recorded. It means "unknown". It does not mean zero.
Pupil 4124 answered three questions and skipped the last one. That empty box becomes a blank cell.
See it done
Data:
class-survey.csv(synthetic), column H,siblings.
Question: in class 5A, how many pupils said they have no siblings, and how many did not answer?
- Look down column H for class 5A (rows 2 to 16).
- Find the zeros. Rows 3 and 4 say 0 (pupils 4109 and 4111). That is 2 pupils who told us they have no brothers or sisters.
- Find the blanks. Rows 7, 9 and 15 are empty (pupils 4124, 4134 and 4166). That is 3 pupils who did not answer.
- Say it carefully. "2 pupils in 5A have no siblings. For 3 pupils we do not know."
Zeros are answers. Blanks are questions nobody answered.
Now see what goes wrong if you mix them up. For both classes (5A and 5B together), Lucía's table has 6 zeros and 4 blanks in siblings. If someone typed 0 into every blank, the table would say 10 pupils have no siblings. Only 6 actually told us that. Four of those "facts" would be made up.
Your turn, with help
Look at column E, favourite_fruit, for both classes (rows 2 to 31). How many blanks are there, and in which rows?
Hint: blank cells are easy to miss when you scroll fast. Go slowly, ten rows at a time.
Show the answer
3 blanks: rows 8, 19 and 20 (pupils 4131, 4190 and 4192). We do not know their favourite fruit.
Your turn, alone
- In class 5B (rows 17 to 31), how many pupils said 0 siblings?
- In class 5B, how many blanks are there in
siblings? - A shop's table has a
sales_todaycolumn. One day's cell is blank. Does that mean the shop sold nothing? What should you do? - Is "I don't know" the same as 0 for the question "how many hours did you sleep?"
Check your answers
- 4 pupils (rows 21, 23, 29 and 30).
- 1 blank (row 17, pupil 4182).
- No. It means the number was not recorded. Ask the shop, and do not count it as 0.
- No. 0 hours means no sleep at all. "I don't know" is a blank.
Watch out
- Filling blanks with 0 "to tidy up". It feels neat, but it invents data. Leave blanks blank unless you truly know the value.
- Blanks that are not empty. Sometimes people type "N/A", "-", "?" or a space instead of leaving a cell empty. They mean "unknown" too, but a computer may not see them as blank. Look out for them.
- Forgetting to report them. Always say how many answers are missing, as in "for 3 pupils we do not know". It tells the reader how far to trust your result.
Say it back
- What does a blank cell mean?
- What does a 0 mean?
- Why is filling blanks with 0 a problem?
Show the answers
- We do not know the value.
- We know the value, and it is none.
- It turns "unknown" into a made-up fact.
What is next
Lucía's first column, pupil_number, is full of numbers. So can you add them up? You can. The answer is a perfectly real number that means absolutely nothing. Next lesson.