

W01 / 2026-09-07 / 35 MIN / ENGLISH
Measurements, missing values, and provenance
Classroom formative practice. This does not add a weekly graded assignment. The exercise time is included in class practice, not added after the three-hour meeting.
Before you start
- Use a CPU runtime. Save a personal copy or open the downloaded notebook in Jupyter.
- Run the included complete walkthrough first. Read its setup, definitions, and checkpoints.
- Predict before running each exercise cell; then change only the requested factor.
- Keep your actual outputs, configuration, explanation, and limitation. Free tools are sufficient.
TASK 1 / PREDICT - RUN - EXPLAIN
Keep raw measurements unchanged
Predict the replacement for the missing temperature. Run the cell, then replace 27 with 270 and rerun. Explain why the cleaning rule must be recorded rather than silently changing raw data.
- Write your prediction in the notebook response field before running.
- Run the starter cell below after the worked walkthrough.
- Make the requested controlled change and record the configuration.
- Explain the mechanism using the actual output, not an invented result.
raw_demo=np.array([[1.,25.,50.],[2.,np.nan,52.],[3.,27.,54.]])
clean_demo=raw_demo.copy()
fill_value=float(np.nanmedian(raw_demo[:,1]))
clean_demo[np.isnan(clean_demo[:,1]),1]=fill_value
observations['task1']={'fill_value':fill_value,'raw_missing':int(np.isnan(raw_demo).sum()),'clean_missing':int(np.isnan(clean_demo).sum())}
print(observations['task1'])Self-check: With the original values, the median is 26. The raw table still has one missing value; the cleaned table has none.
TASK 2 / PREDICT - RUN - EXPLAIN
Identify data without claiming authenticity
Hash the original and cleaned tables. Predict whether the hashes match. Change one measurement and explain what a changed hash does and does not establish.
- Write your prediction in the notebook response field before running.
- Run the starter cell below after the worked walkthrough.
- Make the requested controlled change and record the configuration.
- Explain the mechanism using the actual output, not an invented result.
raw_digest=hashlib.sha256(raw_demo.tobytes()).hexdigest()
clean_digest=hashlib.sha256(clean_demo.tobytes()).hexdigest()
observations['task2']={'raw_sha256':raw_digest,'clean_sha256':clean_digest,'same_bytes':raw_digest==clean_digest}
print(observations['task2'])Self-check: The hashes differ. A hash identifies bytes; it does not prove that a measurement is genuine.
TASK 3 / PREDICT - RUN - EXPLAIN
Separate identifiers from measurements
The first column is a sample ID. Renumber IDs while retaining the same physical measurements. Explain why renumbering must not alter a physical claim.
- Write your prediction in the notebook response field before running.
- Run the starter cell below after the worked walkthrough.
- Make the requested controlled change and record the configuration.
- Explain the mechanism using the actual output, not an invented result.
renumbered=clean_demo.copy(); renumbered[:,0]=[30,10,20]
observations['task3']={'measurement_columns_unchanged':bool(np.array_equal(renumbered[:,1:],clean_demo[:,1:])),'response_mean':float(renumbered[:,2].mean())}
print(observations['task3'])Self-check: Measurement columns and their means remain unchanged. An ID is not automatically a predictive physical feature.
Completion checklist
- Three predictions and three explanations.
- One controlled change with its actual outcome.
- One limitation and a brief AI-use/checking disclosure, or "none".
- A downloaded W01-evidence.json, then a two-minute peer explain-back.
The notebook marks incomplete response records as drafts. Completing the fields is not proof that an explanation is correct.
The guided walkthroughs were previously executed. The new exercise extension cells have not yet been execution-tested for this revision. Agent exercises are deterministic simulations; no paid model or consequential external action is used.