twoHelixestwoHelixes Start free

Datasets / World climate and energy

Change in CO2 per person since 1990

The latest observed value minus the 1990 value, shown for the countries with the largest absolute change in either direction.

Question how has CO2 per person changed since 1990 by country?
Change in CO2 per person since 1990-30-20-1001020QatarOmanMongoliaBruneiUnited StatesSlovakiaGermanyNauruUkraineCuracaoCo2 Change
World climate and energy — 20 rows charted from 8,037, drawn as a hbar
How it decided
Finding the data12 ms

World climate and energy: 8,037 rows, 6 columns. country, year and co2_tonnes_per_person; only countries with both a 1990 and a later value appear.

Shaping the data27 ms

8,037 rows in, 20 out across 2 columns. The latest observed value minus the 1990 value, shown for the countries with the largest absolute change in either direction.

Choosing the chart5 ms

hbar. A signed change across named countries is a ranking, so horizontal bars keep the largest movers legible.

Applying defaults1 ms

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.

df = df.dropna(subset=["co2_tonnes_per_person"])
base = df[df["year"] == 1990].set_index("country")["co2_tonnes_per_person"]
last_rows = df.loc[df.groupby("country")["year"].idxmax()].set_index("country")
last = last_rows["co2_tonnes_per_person"]
change = (last - base).dropna()
ranked = change.abs().sort_values(ascending=False).head(20)
result = ranked.index.to_frame(index=False)
result["co2_change"] = change.reindex(result["country"]).values
result = result.sort_values("co2_change", ascending=False).reset_index(drop=True)

What it charted

20 rows out of 8,037, 2 columns. First 8 shown.

countryco2_change
Qatar15.3095
Trinidad and Tobago9.3732
Oman9.2535
New Caledonia9.1316
Mongolia8.3362
China6.5055
Brunei6.4279
United Kingdom-5.9669