DATA SCIENCE · CYCLE 2 · L16 · TEXTBOOK CHAPTER
Can You Trust the Source?
A big data source nobody can check is a risk. Before you use somebody else’s file, ask who made the data and how. Then run three checks on the data itself: valid, complete and unique.
After this chapter, you can
- Say why a big source nobody can check is a risk.
- Run the valid, complete and unique checks with Sheets counts.
- Tell a repeated id from a repeated row.
- Write the ABOUT tab for somebody else’s data.
For your project: your ABOUT tab says who made your file, and how. The checkpoint is at the end.
Why It Matters
On 22 May 2020 The Lancet, a top medical journal, published a study of a malaria drug, hydroxychloroquine, in COVID patients. The data came from one company’s database, Surgisphere. The study used the records of 96,032 patients in 671 hospitals. It linked the drug to more deaths in hospital.
Three days later, on 25 May, the World Health Organization paused its own trial of the drug. A trial is a test of a drug on patients.
Then reporters checked the study against a number anyone could find. The study counted 73 COVID deaths in Australia by 21 April. Australia had recorded 67 by that day.
One of the study’s four authors was the company’s founder. The other three asked outside experts to check the database. The company would not give the experts its full data. On 4 June, 13 days after it was published, the study was retracted. Retracted means taken back.
A big source nobody can check can stop a trial. Ask who made the data, and whether anyone can check it.
The Idea
Who made it, then three checks
A source is reliable when you can check who made the data and how.
The data is ready when it passes three checks:
| DS.7’s check | It asks | The Sheets count |
| valid | one type and one format in each column? | =COUNT against =COUNTA |
| complete | every value the question needs? | =COUNTBLANK |
| unique | no row in the file twice? | =COUNTUNIQUE, then Data > Data cleanup > Remove duplicates |
The Three Checks on VDOT’s File
In class you ran the three checks on the 2023 traffic file from VDOT, the Virginia Department of Transportation. AADT is its column of traffic counts. Link ID is its id column. An id is a number or code that names one thing, like a student number.
| Check | What the count found |
| valid | =COUNT found 743 numbers. =COUNTA found 743 filled cells. They match, so the column is valid. |
| complete | =COUNTBLANK found 121 blank AADT cells, 14.0% of its 864 rows. Most are ramps, which VDOT does not count. |
| unique | =COUNTUNIQUE found 647 different Link IDs in 864 rows, so 217 rows repeat a Link ID. Remove duplicates found only 3. |
To see the blank rows: Data > Create a filter. Click the filter icon in the column’s header. Clear, tick (Blanks), OK. When you have read them: Data > Remove filter.
A repeated id is not always a repeated row. Link ID 190023 is three pieces of I-66, each starting and ending somewhere else. A duplicate is a row that matches another in every column.
Who Made It
The producer is who made the data. The publisher is who put it out for others to use. For the class file they are the same: VDOT made the counts, and VDOT put the file on data.virginia.gov, where anyone can download it.
Reliable has two meanings here. A reliable source is one you can check: who made the data, and how. A reliable measurement gives about the same number when you measure again. It can still be wrong every time.
The ABOUT Tab for Somebody Else’s Data
Five lines, one in each cell from A1 to A5. This is the tab the class wrote for VDOT’s file.
| Line | Start with | For VDOT’s file |
| 1 | Made by: | the Virginia Department of Transportation |
| 2 | Published by: | VDOT, on data.virginia.gov |
| 3 | How: | estimates for each section of road, one number a section |
| 4 | Where and when: | VDOT’s Arlington maintenance area, Alexandria too; 2023 |
| 5 | What it misses: | 121 sections with no count, most of them ramps |
The three counts cannot tell you where the roads are. The file covers more than Arlington County: 293 of its 864 rows are in the City of Alexandria. Line 4 says so. A reader needs the ABOUT tab as well as the checks.
Worked Examples
Example 1 · Three checks, three counts. An animal shelter shares its March log, one row for each animal that came in. Row 1 is the header row. Run the three checks.
| A | B | C | D |
| 1 | Animal ID | Date in | Kind | Weight (lb) |
| 2 | 4107 | 3/2/2026 | dog | 41 |
| 3 | 4108 | 3/2/2026 | cat | 9 |
| 4 | 4109 | 3/3/2026 | cat | 11 lb |
| 5 | 4110 | 3/5/2026 | dog | |
| 6 | 4108 | 3/9/2026 | cat | 10 |
| 7 | 4111 | 3/9/2026 | rabbit | 4 |
| 8 | 4111 | 3/9/2026 | rabbit | 4 |
| 9 | 4112 | 3/10/2026 | dog | 55 |
Create a strategyOne check at a time, each with its count. Valid: =COUNT and =COUNTA on the weights, D. Complete: =COUNTBLANK on D. Unique: =COUNTA and =COUNTUNIQUE on the id column, A.
Apply the idea
| Cell | Type | It shows |
| F2 | =COUNT(D2:D9) | 6 |
| F3 | =COUNTA(D2:D9) | 7 |
| F4 | =COUNTBLANK(D2:D9) | 1 |
| F5 | =COUNTA(A2:A9) | 8 |
| F6 | =COUNTUNIQUE(A2:A9) | 6 |
Valid. 6 numbers and 7 filled cells, so 7 − 6 = 1 cell holds text: 11 lb, in row 4.
Complete. 1 blank cell: the dog in row 5.
Unique. 8 − 6 = 2 rows repeat an Animal ID. Rows 3 and 6 share ID 4108, with two dates and two weights: the same cat came in twice. Rows 7 and 8 match in every column: a duplicate.
Reflect and checkA count tells you something is there. You still read the rows and fix them. On a copy of the tab, type 11 in D4 and delete row 8, the duplicate. Each fix gets a row on the LOG tab. Leave D5 blank: nobody weighed that dog, and a 0 would say it weighed nothing. Check the counts against each other: 6 numbers + 1 text + 1 blank = 8 rows.
Try It: Break It, Then Fix It
The lab starts on Example 1’s log. Change a cell and watch the counts follow. Then meet the three goals.
Example 2 · A repeated id, or a duplicate? A bike-share company posts one month of trips: one row a trip, 2,400 rows of data, in columns A to F. Column A is the Bike ID. =COUNTA(A2:A2401) shows 2,400. =COUNTUNIQUE(A2:A2401) shows 180. How many rows are duplicates?
Create a strategyThe rows minus the different ids gives the rows that repeat an id. That count cannot say whether a whole row repeats. For that, copy the tab, then run Remove duplicates on every column of the copy.
Apply the idea
2,400 − 180 = 2,220 rows repeat a Bike ID. That is how this file should look: one bike takes many trips.
- Right-click the tab at the bottom of your sheet > Duplicate.
- Right-click the copy > Rename > CLEAN.
- Click the Name box, left of the formula bar. Type A1:F2401.
- Press Return.
- Data > Data cleanup > Remove duplicates.
- Tick Data has header row.
- Click Remove duplicates.
Sheets reports 36 duplicate rows found and removed. 2,400 − 36 = 2,364 rows are left on CLEAN.
Reflect and check2,220 rows repeat an id, and only 36 repeat a whole row: 36 ÷ 2,400 × 100 = 1.5% of the rows were in the file twice. The first tab still holds all 2,400 rows, because the file as it was published is never changed. The LOG tab gets one row: Remove duplicates, 2,400 rows before, 2,364 after.
Example 3 · The ABOUT tab, and two kinds of reliable. The Statistics Club timed the wait in the lunch line: the main cafeteria, first lunch, 20 school days in October 2026. Two students timed it with a phone stopwatch. The times are in B2 to B21, one number a day, and =COUNTBLANK(B2:B21) shows 3. The front office posted the club’s file on the school website. Write the file’s ABOUT tab. Is the source reliable?
Create a strategyFive lines, one for each thing a reader will ask: who made it, who put it out, how, where and when, and what it misses. Then one more question: can anyone check it?
Apply the idea
- Click + (Add Sheet) at the bottom left.
- Right-click the new tab > Rename > ABOUT.
- In A1 to A5, type one line each, as in the table.
| Cell | Type |
| A1 | Made by: the Statistics Club |
| A2 | Published by: the front office, on the school website |
| A3 | How: two students timed the wait with a phone stopwatch, one number a day |
| A4 | Where and when: the main cafeteria, first lunch; 20 school days in October 2026 |
| A5 | What it misses: second lunch, and 3 days with no number |
The source is reliable: you can check who made the data and how. You can ask the club.
Reflect and checkThe producer and the publisher differ here. The club made the data, and the office put it out. Is each time a reliable measurement? That is another question. On one day both students timed the same wait, and both got 6 minutes. Measure again, get about the same number: reliable.
The Same in Python
Python comes in L19b. Once you have read it, come back and run Example 1’s id column here. One word is new: .nunique() counts the different values in a column, as =COUNTUNIQUE does in Sheets.
In Sheets this is: =COUNTA(A2:A9) and =COUNTUNIQUE(A2:A9).
In English:
- Get the pandas toolbox and call it pd.
- Make a column of the eight Animal IDs, and call it ids.
- Print how many rows ids has.
- Print how many different values ids has.
Predict: two IDs are in the list twice. What will line 4 print?
Can’t run it here? Show what it prints
8 rows
6 different IDs
The same 8 and 6 as F5 and F6 in Example 1.
Want to type your own? The Python practice page has tasks and a notebook.
In your project
Your Cycle 2 project is one Google Sheet with RAW, CLEAN, LOG, ABOUT and ANALYSIS tabs, and a one-page memo. It starts from a file somebody else made. The ABOUT tab names who made the data and how, in Example 3’s five lines. The LOG tab records each fix, as Example 2 does: 2,400 rows before, 2,364 after. Every fix happens on CLEAN. Nothing in RAW is ever changed. Your one-page memo says where the data comes from and who made it. Take that from the ABOUT tab.
Check Yourself
Answer each one before you look. The first one is from an earlier lesson.
File > Download > Comma-separated values (.csv) saves your CLEAN tab out of Sheets as a file. What is that move called? L15
An export saves a tab out of a tool as a file. An import goes the other way: it brings a file’s rows into a tool. A separator is the character between values, like a comma.
Swim times are in C2 to C76. =COUNTA(C2:C76) gives 75. =COUNT(C2:C76) gives 69. One cell says 31 sec. On CLEAN, you retype it as 31. What does =COUNT(C2:C76) give now?
69 + 1 = 70. The cell now holds a number, so =COUNT goes up by one. =COUNTA stays at 75: the cell was filled before, and it is filled now. 75 − 70 = 5 cells still hold text. The column is valid when the two counts match.
A column of daily rainfall holds 325 days. =COUNTBLANK finds 26 blank cells. What percent of the days are blank?
26 ÷ 325 × 100 = 8%. That is the complete check. Leave the 26 cells blank: a 0 would say the rain was measured and none fell. Say on the ABOUT tab that 26 days have no reading.
A library file has one row for each checkout. Column A is the Book ID. =COUNTA(A2:A1201) gives 1,200. =COUNTUNIQUE(A2:A1201) gives 1,145. Are the rows that repeat a Book ID duplicates?
1,200 − 1,145 = 55 rows repeat a Book ID. A repeated id is not always a repeated row: one book is checked out many times. A duplicate matches another row in every column, so run Remove duplicates on a copy. “Every id once” fits a list of books, with one row for each book. “Never” is wrong too: a checkout typed in twice is a duplicate.
A city health department counts flu cases each week. A local news site posts the file for its readers. Who is the producer?
The producer is who made the data: the health department counted the cases. The news site is the publisher: it put the file out for others to use. A reader uses the data and made none of it.
The Garden Club measured the height of every sunflower in the school garden in July 2026, with a tape measure. The school posted the file. Which line 3 belongs on the file’s ABOUT tab?
Line 3 says how the data was made: each sunflower was measured with a tape measure. Who posted the file goes on line 2, Published by:. The place and the month go on line 4, Where and when:.
A website posts: teens sleep 6.1 hours a night. It names no author and no method. Is it a reliable source?
A source is reliable when you can check who made the data and how. Here you can check neither. An exact number proves nothing: 6.1 is as easy to make up as 6. Anyone can post a number on a website. Ask first: who made it, and how was it collected?
Two coaches time one runner’s lap. Both press start 2 seconds late. Both stopwatches read 61 seconds. What do the matching times show?
Measure again and get about the same number: that is a reliable measurement. It is still wrong. Both coaches started late, so the lap took 61 + 2 = 63 seconds. A reliable measurement can be wrong every time. A reliable source is another idea: one you can check.
Project Checkpoint
Stuck on any of this? Ask Mr. Case in class or send him a message in Canvas. Name the example or the question number, and say which step lost you.