Datasets / World food and health
Income against obesity, latest year with both
Both measures come from the one latest year where a country has both an income and an obesity figure, so the scatter compares countries in the same year instead of mixing vintages.
How it decided
World food and health: 7,485 rows, 7 columns. country, gdp_per_capita_ppp and obesity_pct in the latest shared year.
7,485 rows in, 186 out across 3 columns. Both measures come from the one latest year where a country has both an income and an obesity figure, so the scatter compares countries in the same year instead of mixing vintages.
scatter. Two measures, no category and no time: a scatter of one point per country makes the relationship itself the chart.
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.
usable = df.dropna(subset=["gdp_per_capita_ppp", "obesity_pct"])
latest = usable["year"].max()
result = usable[usable["year"] == latest][["country", "gdp_per_capita_ppp", "obesity_pct"]]
What it charted
186 rows out of 7,485, 3 columns. First 8 shown.
| country | gdp_per_capita_ppp | obesity_pct |
|---|---|---|
| Afghanistan | 1964.4523 | 18.7741 |
| Angola | 8752.798 | 11.7797 |
| Albania | 21640.984 | 27.2673 |
| Andorra | 66232.74 | 19.5468 |
| United Arab Emirates | 69701.79 | 30.2821 |
| Argentina | 26771.965 | 38.0566 |
| Armenia | 20078.785 | 28.567 |
| Antigua and Barbuda | 29298.646 | 35.4071 |