Datasets / World climate and energy
Renewable share against CO2 per person, latest year per country
One point per country in its latest year with both indicators observed, so the relationship is read across countries rather than over time.
How it decided
World climate and energy: 8,037 rows, 6 columns. renewable_electricity_pct and co2_tonnes_per_person in each country's latest year with both values.
8,037 rows in, 201 out across 3 columns. One point per country in its latest year with both indicators observed, so the relationship is read across countries rather than over time.
scatter. Two measures with no time axis is a scatter; no colour column keeps the palette to a single series.
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=["renewable_electricity_pct", "co2_tonnes_per_person"])
latest = df.groupby("country")["year"].transform("max")
result = df[df["year"] == latest][["country", "renewable_electricity_pct", "co2_tonnes_per_person"]]
result = result.sort_values("renewable_electricity_pct").reset_index(drop=True)
What it charted
201 rows out of 8,037, 3 columns. First 8 shown.
| country | renewable_electricity_pct | co2_tonnes_per_person |
|---|---|---|
| Comoros | 0.0 | 0.6375 |
| Grenada | 0.0 | 3.216 |
| Guinea-Bissau | 0.0 | 0.1554 |
| Gambia | 0.0 | 0.2909 |
| Montserrat | 0.0 | 6.0215 |
| East Timor | 0.0 | 0.477 |
| Saint Pierre and Miquelon | 0.0 | 9.335 |
| Saint Helena | 0.0 | 2.0636 |