Lab · Data Science, Machine Learning and AI
Lab: how long do our deliveries take?
The brief
A cloud kitchen wants to promise customers a delivery time. Describe one evening's 15 deliveries with the mean, median, spread and quartiles, find the outlier, and check how strongly distance and time move together.
Why it matters
Food-delivery and quick-commerce companies set the "arrives in 30 minutes" promise from exactly these numbers. Operations analysts report the median and the spread rather than only the average, flag unusual orders before they distort the figures, and check what really drives delivery time.
Skills you practise
- mean and median
- range and standard deviation
- quartiles and IQR
- outliers
- Pearson correlation
What you will have at the end
stats.py: a small statistics toolkit (centre, spread, quartiles, outliers, correlation) and a two-line note on what delivery time the kitchen can honestly promise.
How it is marked (rubric, 100 points)
| Correct statisticsAll five checks pass, including the empty, single-value and no-spread cases. | 50 |
|---|---|
| Right measure for the jobYou can say why the median and the sample SD suit this data better than the mean and the population SD. | 20 |
| Outlier handled honestlyThe rain order is flagged and explained, not silently deleted. | 15 |
| Clear conclusionA short note says what the kitchen should promise and why, quoting the median and Q3. | 15 |
0/5 steps done
Step 1 of 5
The typical delivery
centre(values) returns (mean rounded to 2 places, median): (32.2, 27) for MINUTES.
The mean adds everything and divides by the count, so one very slow order pulls it up. The median is the middle value once the list is sorted, so it barely moves. Use statistics.mean and statistics.median, and round only the mean. An empty list has no centre, so return (None, None).
Run shows what your code prints. Check runs the step's tests. Ctrl+Enter checks too.