Course / Tutorials / Week 10 / Q-29
Quick tutorial Q-29 · Week 10 · about 15 min · Foundation
Median and spread of ten trials
Read ten results files into one table and describe each metric with a median and a robust spread, and see what one low shot does to the mean.
- 1Gather (used)
- 2Statistics (used)
- 3Visualize (used)
- 4Cleanse
- 5Features
- 6Balance
- 7Scale
- 8Split
- 9Deploy
- Ask
- Collect (this week)
- Check (this week)
- Interpret
- Coach
- Reassess
Download notebook ·Python file ·Read as Markdown ·Data folder ·Chapter 10 (sections 4.6, 4.8, 10.6)
Every cell runs in this page; the first run downloads Python (about 30 s). Nothing you load leaves your browser. Helpful first: Q-28 Height from flight time, with one frame of error.
The decision
A shooter wants one number for "my release angle" to train against. From ten shots, which summary should it be, and how much spread is normal for this shooter?
The raw data
raw/results/results_shot01.md: one of ten SYNTHETIC basketball results files (results_shot01.md to results_shot10.md) in the layout of the apps' text results, made with a fixed random seed. Chapter 10's synthetic example data (book/ch10-skill/data/results/), made bycode/make_synthetic_results.py. Not a measurement of anyone.raw/shot_log.csv: the SYNTHETIC made-or-missed log, one row per shot. Same source.
Try it
One shot is an anecdote; ten shots are a sample (Section 10.6). The raw files are ten results files in the layout the basketball app writes, one per shot, and the made-or-missed log the shooter kept by hand. They are synthetic: Chapter 10 made them with a fixed random seed so that everyone gets the same numbers. They are not measurements of anyone.
Type a prediction to enable Run.
Show the expected result without running
Ball Release Angle Ball Release Height Elbow Angle Knee Flexion Release Timing vs Apex made file results_shot01.md 46.3 1.07 159.0 97.0 -23.0 1 results_shot02.md 48.8 1.10 160.0 105.0 -25.0 1 results_shot03.md 43.0 1.03 158.0 102.0 -17.0 0 results_shot04.md 46.2 1.09 157.0 92.0 -15.0 1 results_shot05.md 46.5 1.06 161.0 97.0 -22.0 1 results_shot06.md 40.8 1.04 162.0 109.0 3.0 0 results_shot07.md 48.0 1.04 157.0 102.0 -19.0 1 results_shot08.md 47.6 1.05 160.0 105.0 -8.0 0 results_shot09.md 47.2 1.07 160.0 105.0 -26.0 1 results_shot10.md 46.8 1.05 160.0 97.0 -7.0 0
Center and spread, two ways
The mean and standard deviation use every value's size, so one wild value moves them. The median and the interquartile range (IQR, the middle half) or the median absolute deviation (MAD, the median distance from the median) do not. The disc app scales the MAD by 1.4826 (disc/src/lib/metric-registry.ts), which turns it into a robust standard deviation: for normal scatter the raw MAD is only about two thirds of one.
Show the expected result without running
mean SD median IQR MAD 1.4826 MAD Ball Release Angle 46.12 2.42 46.65 1.27 0.75 1.11 Ball Release Height 1.06 0.02 1.06 0.03 0.02 0.02 Elbow Angle 159.40 1.65 160.00 1.75 1.00 1.48 Knee Flexion 101.10 5.20 102.00 8.00 4.00 5.93 Release Timing vs Apex -15.90 9.33 -18.00 13.00 6.00 8.90 release angle without its lowest shot: mean 46.71, median 46.80
Show the expected result without running

Eight of the ten release angles sit between 46.2° and 48.8°; two missed shots, 40.8° and 43.0°, sit well below. Those two pull the mean (46.12°) below the median (46.65°) and more than double the standard deviation (2.42°) compared with the robust spread (1.4826 × MAD = 1.11°). Drop the lowest shot and the mean jumps by 0.59° while the median moves by 0.15°. That is why the apps build a personal baseline from medians and MADs: one bad shot, or one frame where the ball was lost, should not move the target. The low shots are not errors to delete, though; both were misses, and CS-14 asks whether release angle separates makes from misses.
For the athlete: your release angle is about 46.7°, give or take about 1°; judge the next session's ten shots against that, not against your best shot.
With your own data
Save the text results of ten of your own clips from one app, in one folder, keep a made-or-missed log, and run the first cell on that folder.
Check yourself
Ten values; one is far below the rest. Which summary moves least if you drop it?
A MAD of 0.75° is scaled by 1.4826. What robust standard deviation does that give?
The same method in another field
Robust summaries are the standard for any repeated measurement with occasional bad readings: ten readings of a gauge, a sensor with dropouts, lab replicates.
Acknowledgements
Synthetic results files from Chapter 10 of Data-Driven Athletics.
References
- Chapter 10 of Data-Driven Athletics: Many Trials; Medians and spread.
Built 2026-11-30 with Python packages numpy 2.5.5, pandas 3.1.1, matplotlib 3.11.2. In the browser the same code runs on Pyodide, so the last digit can differ.