Class 9 · Unit 2: Data literacy · Lesson 2.3 · 40 min
Acquiring and preparing data
Row 14: a box of Delicious sold for ₹9,000. That's ₹900 a kilo. Apples aren't saffron.
Today you will: Hunt impossible values, mixed units and bad labels · Keep a change log · Know when to leave data out
Story
Bilal's group is predicting apple prices. They found a price list from the Sopore mandi and opened it expecting to start work.
Row 14 says a box of Delicious sold for ₹9,000.
Bilal: “That's the good news. Prices are up.”
Hiba does the arithmetic out loud. A box holds about ten kilograms. Nine thousand rupees for ten kilograms is nine hundred rupees a kilogram. Apples are not saffron.
Hiba: “That number isn't a price. It's a mistake. And if we don't find the rest of them, our whole prediction is built on it.”
She is right — but how do you find a wrong number in a file of four hundred rows?
Watch
Before you analyse, prepare — — scan code 9.2.3 in the printed book.
Warm up your fingers
Skill: brackets and quotes, in pairs (Term 1 focus, 5 min)
-
On typing.com, continue the symbols lessons.
-
Then type each of these five times. Every one is a formula you will use today:
=COUNTIF(C2:C40;"Delicious") -
Brackets and quotation marks always come in pairs. Train the pair as one movement: open, type, close. Depending on the laptop's language setting the separator is
;or,.
On the laptop
You need: LibreOffice Calc · mandi-prices-messy.ods · change-log.ods
Mission 1: Copy first (1 min)
- ☐1
Open
mandi-prices-messy.odsand immediately save a copy with your roll numbers. Never clean the only copy.
Mission 2: Hunt three kinds of fault (13 min, in pairs)
- ☐2
Predict: how many rows will you have to change or remove? Write a number.
- ☐3
Impossible values: sort by
Price, descending. For each suspect, ask what is that per kilogram? - ☐4
Mixed units: use the
Unitcolumn. Convert per-kg rows to per-box at 10 kg a box. If a row has no unit, mark itunknownand leave it out — don't guess. - ☐5
Inconsistent labels: Data → AutoFilter on
Variety. Choose one spelling for each and fix the rest. - ☐6
Log every change in
change-log.ods: Row · What was wrong · What we did · Why.
Mission 3: Count and ask (4 min)
- ☐7
Write: rows at the start · changed · removed · rows you trust. Then the one question you'd ask the mandi clerk.
Finished early?
Find a price that is possible but suspicious. What would it take to trust it?
No laptop today?
Mark the twelve-row printed table with I (impossible), U (unit), L (label), then rewrite it cleanly with a four-column change log beside it.
Now you know
- Data arrives four ways: you measure it, ask for it, observe it, or use someone else's records. Each brings its own faults.
- Acquire well: name the source, get permission when it's about people, record when and how, and don't take only the easy cases.
- Pre-processing hunts impossible values, mixed units and inconsistent labels, as well as duplicates and gaps.
- Check a number against what you already know. You knew ₹900 a kilo was wrong before you opened the file.
- A change log turns tidying into evidence. What you can't fix honestly, mark and leave out.
🕌 From our heritage
Ibn Khaldūn (1332–1406) opened his Muqaddimah by attacking historians who repeated impossible numbers. One chronicle gave an ancient army as six hundred thousand men; he answered that a far larger empire could barely field a fraction of that, and that a state that size would have left traces nobody can find. His rule was that in reports of money and troop numbers, "exaggeration is to be expected", so a figure must be tested against what we know of the world and against the rules of probability. That is precisely the test Hiba ran on ₹9,000 a box.
Source: Ibn Khaldūn, al-Muqaddimah (1377), on the criticism of historical reports.
Debate it
Your pair removed nine rows, including four where the unit was missing. A classmate says: "Now your data is smaller, so your answer is worse."
Is a smaller, trustworthy dataset worse than a bigger one with mistakes in it? When would each answer be right?
Check yourself — practice, not a test
1. Put these pre-processing steps in a sensible order:
- 1. Fix mixed units and inconsistent labels
- 2. Find impossible values and check them against what you know
- 3. Record every change in the change log
- 4. Save a copy of the original
2. A row gives a price but no unit. The honest thing is to:
- ○ Assume it is per box, like most rows
- ○ Assume it is per kilogram, to be safe
- ○ Mark it unknown and leave it out of the analysis
- ○ Delete it silently
3. Delicious and delicious count as the same variety when a machine groups the rows.
- ○ True
- ○ False
4. Which are ways of acquiring data? (choose all that apply)
- ○ Measuring it yourself
- ○ Asking people in a survey
- ○ Observing and recording
- ○ Using records someone already keeps
- ○ Estimating what it probably was
5. A ______ log records what was wrong, what you did and why — so that somebody else can check your cleaning.
Remember
Cleaning is not tidying. Every change gets a reason, and a line in the log.