Change in GDP per capita since 1990, top 20
Every bar is a difference between a country's 1990 value and its most recent value, so the chart shows how far each country moved over the period rather than where it ended up.
How it decided
World prosperity: 8,415 rows, 8 columns. country, year and gdp_per_capita_ppp for 1990 and the latest year; missing values are dropped.
8,415 rows in, 20 out across 2 columns. Every bar is a difference between a country's 1990 value and its most recent value, so the chart shows how far each country moved over the period rather than where it ended up.
hbar. A difference per country is one measure with text labels, so sorted horizontal bars are clearest.
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.
d = df.dropna(subset=["gdp_per_capita_ppp"])
early = (d[d["year"] == 1990][["country", "gdp_per_capita_ppp"]]
.rename(columns={"gdp_per_capita_ppp": "gdp_1990"}))
latest = d.loc[d.groupby("country")["year"].idxmax(), ["country", "gdp_per_capita_ppp"]]
latest = latest.rename(columns={"gdp_per_capita_ppp": "gdp_latest"})
merged = early.merge(latest, on="country")
merged["change"] = merged["gdp_latest"] - merged["gdp_1990"]
result = (merged.sort_values("change", ascending=False)
.head(20)[["country", "change"]].reset_index(drop=True))
What it charted
20 rows out of 8,415, 2 columns. First 8 shown.
| country | change |
|---|---|
| Ireland | 101833.563 |
| Singapore | 93631.55 |
| Guyana | 78584.249 |
| Macao | 61797.524 |
| Luxembourg | 45965.57 |
| Malta | 45447.411 |
| South Korea | 41319.202 |
| Norway | 38565.176 |