Purpose, dictionary and inventory
Q1–Q2 · 15 points
The six quality dimensions are applied to a concrete task. The dictionary decides the score scale, date order and allowed programme meanings.
Week 3: dictionary and quality, PDF pp. 6–15
Your task
Inspect rows, distinct students, roster coverage and blanks. Explain each quality dimension and the required conversions.
Evidence to include
Use actual counts and fields. Where accuracy or timeliness cannot be diagnosed, name the source check needed.
Notebook questions and code
Read here; run in your downloaded notebook. Start with its setup cells and run in order. Use your own ID and outputs where requested.
Download Lab 3 notebook1 · What does “clean” mean for this task?
You are preparing a current registry of 12 fictional students. The question is: What entry scores are observed, and how complete is our information about this cohort? These are synthetic teaching data, not university records.
One final row = one current student. A separate weekly-results table would have a different row definition.
| Field | Meaning and rule |
|---|---|
| student_id | Text identifier, unique in the final registry; preserve leading zeros |
| programme | Biology, Bioengineering, or Economics; the source confirms BIO means Biology |
| group | Day or Evening; known for every student |
| age | Years; dictionary accepts 16–100 for this fictional cohort, but validity does not prove accuracy |
| entry_score | Points out of 100. Here “80%” means 80 points; plain numbers already mean points |
| phone | Contact number; not required for score summaries |
| updated_at | Source revision date, explicitly day/month/year; newest does not automatically mean authoritative |
The expected roster contains exactly IDs 00101–00112. Blank strings represent missing values. Source notes will be supplied in Part 2.
Python · cell 5 — read here, run in your notebook
ids = [f"{101+i:05d}" for i in range(12)]
scores = rng.integers(55, 91, 12)
older_age = int(rng.choice([43, 47, 52]))
base = pd.DataFrame({
"student_id": ids,
"programme": [" biology ", "BIO", "Biology", "Bioengineering", "Economics", "Economics"]*2,
"group": ["Day"]*8 + ["Evening"]*4,
"age": ["19", "20", "220", "21", "19", "22", "20", "21", str(older_age), "22", "21", "20"],
"entry_score": [str(x) for x in scores],
"phone": [f"555-{i:04d}" for i in range(12)],
"updated_at": ["03/04/2026"]*12,
})
base.loc[3, "entry_score"] += "%"
base.loc[5, "entry_score"] = ""
base.loc[9, "entry_score"] = "seventy"
base.loc[10, "phone"] = ""
correction = base.iloc[[1]].copy()
correction["entry_score"] = str(min(int(scores[1])+7, 100))
correction["updated_at"] = "05/04/2026"
raw = pd.concat([base, base.iloc[[0]], correction], ignore_index=True)
raw.insert(0, "record_id", [f"R{i+1:02d}" for i in range(len(raw))])
raw_snapshot = raw.copy(deep=True)
display(raw)
print("Rows:", len(raw), "| Distinct students:", raw.student_id.nunique())
print("Expected roster IDs absent:", sorted(set(ids)-set(raw.student_id)))
print("Blank cells by field:")
display(raw.eq("").sum().rename("blank_cells").to_frame())Your explanation
Q1 · Quality depends on purpose (8 points).
- Identify one issue for each of completeness, validity, consistency, uniqueness, accuracy, and timeliness. For dimensions not diagnosable here, state a concrete check or external evidence needed; do not invent an error.
- Which missing field matters for urgent phone calls but not for the entry-score summary? Why should its blank not cause the whole row to be deleted?
- Give the row count, distinct-student count, and absent-roster count in your version. Why can these three quantities differ?
Write here: …
Your explanation
Q2 · Meaning before conversion (7 points).
- In this dictionary, what number should replace the percentage text? Why would automatically dividing it by 100 be wrong here?
- What happens if identifiers become integers? Interpret 03/04/2026 using the documented source convention.
- Explain why “seventy” is not the same situation as an originally blank score. Does a parser failure prove the intended value was zero?
Write here: …
Saved only in this browser. This note doesn’t fill in the downloaded notebook; “reviewed” is a personal checklist, not a grade.