Field note · June 13, 2023
Five minutes with pm25 in city-air-quality
5,480 rows, 480 distinct values, and the one fact about pm25 that changes how you query it.
Someone asked what is in pm25 on city-air-quality, and the honest answer took one query.
5,480 rows, 85 nulls (1.6%), 480 distinct values. PM2.5, µg/m³. Blank when the monitor was offline.
The five-number version: min 1.00, p10 5.70, median 15.70, p90 31.30, max 122.60. The mean is 17.49.
The p10 to p90 band — 5.70 to 31.30 — 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.
85 rows have no value at all here, which is 1.6% 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 5,395 rows, not 5,480, and the two denominators produce different answers.
select
count(*) as rows,
count(pm25) as present,
count(*) - count(pm25) as nulls,
count(distinct pm25) as distinct_values
from city_air_quality;Nothing dramatic: the mean and median are within 11.4% of each other, so an average is a fair summary. That is worth confirming rather than assuming — it is not true of most money columns.
Where this matters: a symmetric column is one you can average, threshold and chart without hedging, which makes it unusually cheap to work with. Knowing which of your columns are like this and which are not is most of knowing when to be careful.
The grain is one row per city per day, 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.