Field note · August 3, 2023
Five minutes with arr_delay_min in flight-delays
8,000 rows, 261 distinct values, and the one fact about arr_delay_min that changes how you query it.
Someone asked what is in arr_delay_min on flight-delays, and the honest answer took one query.
8,000 rows, 167 nulls (2.1%), 261 distinct values. Arrival delay in minutes. Null if cancelled.
The five-number version: min -59, p10 -20, median 2, p90 29, max 485. The mean is 7.
The p10 to p90 band — -20 to 29 — is where ordinary rows live, and it is the pair worth quoting when somebody asks what to expect. Min and max describe the two strangest rows in the table and nothing else; they are useful for spotting impossible values and misleading for everything else.
167 rows have no value at all here, which is 2.1% of the table. That is enough to move an aggregate and small enough that nobody notices it doing so — every average above is computed over 7,833 rows, not 8,000, and the two denominators produce different answers.
select
count(*) as rows,
count(arr_delay_min) as present,
count(*) - count(arr_delay_min) as nulls,
count(distinct arr_delay_min) as distinct_values
from flight_delays;The mean sits 228% above the median, which is the whole story: anything that reports the average of arr_delay_min is reporting a number most rows are below. Put the median next to it or drop the mean.
Where this bites: a filter like arr_delay_min > 7 reads as "above average" and selects a minority of rows — a smaller minority than the phrase suggests to whoever asked for it. If the request was "the typical ones", the threshold they meant was 2.
The grain is one row per scheduled flight, which is the context every one of those numbers depends on. None of them survive a change of grain, which is why "profile the column" and "profile the table" are the same job. Full schema, and the CSV, on the dataset page.