What an average hides
Use your own case to calculate, plot and explain the data.
The notebook generates 240 synthetic students from your student ID. It needs no dataset download. Enter your own 6–12 digit ID and keep it unchanged. The site does not run the notebook or invent your case-specific results.
Start here: notebook introduction and setup
Lab 2 · What an average hides
Data Science Fundamentals — Week 2: Describing Data
Mohammad Sabokrou · New Uzbekistan University
Your job: use evidence to explain data and make a defensible decision. The Python is provided; programming complexity earns no extra credit.
Name: … Student ID: enter in the setup cell below.
How to work
- Open this notebook in Google Colab or Jupyter. Run the setup with your own ID.
- Work from top to bottom. Where asked, write a prediction before running the next cell. Keep the prediction even if it is wrong; explain what you learned.
- Double-click an Answer cell to write. Use your own generated numbers and refer to specific plots. A number without an interpretation is incomplete.
- Run the supplied code; change only the explicitly labelled settings. You are responsible for understanding and explaining the results you submit.
- Keep the same ID throughout. Restart and run all cells after finishing; save the notebook with outputs.
Suggested pace: setup 5 min; sections 1–8: 10, 15, 15, 15, 15, 10, 15, 15 min; final check 5 min (120 min total). Finish the written reflection after class if needed.
What varies between students?
Your ID determines the data, eight-number exercise, selected record, histogram settings, and decision scenario. The concepts and workload stay comparable. Reusing an ID gives the same case. Different IDs are not a guarantee that every individual number differs.
All records are synthetic teaching data, not real university records. There are no downloads, joins, or missing code blocks to debug.
Evidence standard: answers should contain a claim, a number or plot observation from your case, and a reason or limitation. We assess statistical reasoning, appropriate methods, and reproducible evidence—not Python fluency.
Python · cell 2 — read here, run in your notebook
# SETUP — edit only STUDENT_ID. Integers and quoted IDs both work.
STUDENT_ID = "YOUR_ID"
import hashlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from IPython.display import display
STUDENT_ID = str(STUDENT_ID).strip()
if not (STUDENT_ID.isascii() and STUDENT_ID.isdigit() and 6 <= len(STUDENT_ID) <= 12):
raise ValueError("Replace YOUR_ID with your own 6–12 digit student ID, then run again.")
seed = int.from_bytes(hashlib.sha256(('FDS-Lab2-v1:' + STUDENT_ID).encode()).digest()[:8], 'big')
rng = np.random.default_rng(seed)
case_code = hashlib.sha256(('FDS-Lab2-v1:' + STUDENT_ID).encode()).hexdigest()[:10]
plt.rcParams.update({'figure.figsize': (8, 4), 'axes.spines.top': False, 'axes.spines.right': False})
pd.options.display.float_format = '{:.3f}'.format
N = 240
programme = rng.choice(['A', 'B'], N, p=[.55, .45])
entry = np.clip(rng.normal(rng.uniform(62,68), rng.uniform(8,11), N), 0, 100)
minutes = rng.lognormal(rng.uniform(4.1,4.4), .85, N)
# Two different teaching groups: their score patterns intentionally differ.
assessment = np.clip(rng.normal(np.where(programme == 'A', 43, 78), 4.5), 0, 100)
satisfaction = rng.choice([1.,2.,3.,4.,5.], N, p=[.08,.12,.2,.35,.25])
satisfaction[rng.choice(N, size=int(rng.integers(35,61)), replace=False)] = np.nan
students = pd.DataFrame({'record_id':np.arange(1,N+1), 'programme':programme,
'entry_score':entry, 'weekly_minutes':minutes,
'assessment_score':assessment, 'satisfaction':satisfaction})
small = np.sort(rng.choice(np.arange(35,86), 8, replace=False)).astype(float)
focus_index = int(np.argmax(entry))
coarse_bins = int(rng.choice([2,3,4]))
fine_bins = int(rng.choice([35,40,45]))
scenario = str(rng.choice(['typical use', 'total workload']))
print('Case:',case_code, '| ID:',STUDENT_ID, '| Final decision:',scenario)
print('Keep this case code in your submission. Setup complete.')Lecture-to-lab connections 8 sections
Who and what are being described? →
The lecture's summary context becomes a denominator check: all student rows for a response rate, recorded ratings for an observed mean.
Week 2: measurement and summary context; Week 1 rows and types
Calculate eight scores by hand →
The mean and SD formulas in the lecture are applied to your eight generated scores. The code checks your working after you try it.
Week 2: centre and spread, PDF pp. 10–30
Quartiles and a changed maximum →
The lecture's robust summaries are tested by changing one extreme value. The lab also makes the quartile convention explicit.
Week 2: quartiles, range and sensitivity, PDF pp. 10–30
Read shapes and compare bins →
Mean, median and skewness are clues; the four plots show what they miss. Changing bins changes the picture, not the data.
Week 2: shape, bins and normal approximation, PDF pp. 33–43
Boxplots and hidden groups →
The lecture's fences and whiskers become record-level checks. Programme summaries and two equal-mean/SD classes show why the whole shape matters.
Week 2: boxplots and grouped summaries; Week 3 outliers is a later connection
Test the normal-model approximation →
The 68–95–99.7 rule is compared with observed proportions. It is an approximate model statement, not a guaranteed sample result.
Week 2: normal approximation, PDF pp. 33–43
Z-scores and the reference group →
The same raw score gets different z-scores when the reference changes. This lab uses sample SD (ddof=1); the Week 4 prediction scaler uses training-only population-style SD (ddof=0).
Week 2: z-score, rank and specification, PDF pp. 45–50; Week 4 scaling is a later connection
Choose a summary for the decision →
The lecture's question-first approach decides which summary to use: a typical student and total observed workload are different requests.
Week 2: typical use versus total workload, PDF p. 58
Before submitting
Answer 1A–8B, include the hand calculations and approximately 150-word recommendation, keep plots and outputs, and save as STUDENTID_Lab2_FDS.ipynb after restarting and running all. Use the current course submission channel.
Notebook submission instructions
Submission checklist
- My name, student ID, and case code are present and consistent.
- I kept predictions and explained any revisions.
- I answered 1A–8B, including the hand calculations and approximately 150-word note.
- Four column plots and all other supplied results are visible.
- My answers cite my own numbers, units, group definitions, and plot evidence.
- I stated the quartile convention and sample/population SD choice where relevant.
- I did not automatically remove outlier candidates or make unsupported causal claims.
- I restarted and ran all cells using my own ID, then saved with outputs.
Save as STUDENTID_Lab2_FDS.ipynb, replacing STUDENTID with your ID. Submit through the course's announced channel and follow its current email-subject rule. The reflection belongs inside this notebook; no separate report is needed.
What a strong submission demonstrates
Correct calculations are the starting point. Strong work explains why a summary fits the question, distinguishes observations from assumptions, recognises what averages conceal, and supports a decision with personalised evidence.
Aligned with Week 2: Describing Data, slides 2–65. This lab focuses on describing and interpreting data; full data-cleaning procedures follow in Week 3.
Source: Lab_02_Describing_Data_Student(2).ipynb. The download is a study copy; the original upload is unchanged.