Average PM2.5 by city
Averaged over the year, the ranking is stable - the worst city is not the one with the worst single month.
How it decided
City air quality: 96 rows, 11 columns. city and pm25_ug_m3, averaged over the months present.
96 rows in, 8 out across 2 columns. Averaged over the year, the ranking is stable - the worst city is not the one with the worst single month.
bar. Named categories ranked on one measure: horizontal bars if the names are long, vertical here - twelve cities fit either way.
Palette, spacing, axis titles and legend placement applied. 0 issues found.
The transformation
This is the code, not a description of it — the chart above was drawn from what it returns, and the notebook download runs the same lines against the same file.
result = df.groupby("city", as_index=False)["pm25_ug_m3"].mean().sort_values("pm25_ug_m3", ascending=False)
What it charted
8 rows out of 96, 2 columns. First 8 shown.
| city | pm25_ug_m3 |
|---|---|
| Delhi | 56.1833 |
| Tokyo | 42.6833 |
| Cairo | 41.6833 |
| London | 29.1833 |
| Sao Paulo | 24.6833 |
| Mexico City | 20.1833 |
| Chicago | 15.6833 |
| Los Angeles | 11.1833 |