Carbon dioxide (CO2) emissions from Waste (Mt CO2e)

Source: worldbank.org, 03.09.2025

Year: 2023

Flag Country Value Value change, % Rank
Albania Albania 0.0029 0% 43
Argentina Argentina 0.012 +1.69% 32
Australia Australia 0.0158 0% 28
Austria Austria 0.0008 0% 60
Azerbaijan Azerbaijan 0.0024 0% 46
Belgium Belgium 0.0023 -4.17% 47
Benin Benin 0.0004 0% 64
Bulgaria Bulgaria 0.0013 -18.8% 56
Bahamas Bahamas 0.001 0% 58
Bosnia & Herzegovina Bosnia & Herzegovina 0.0038 0% 41
Belarus Belarus 0.0123 -6.11% 31
Bolivia Bolivia 0.0026 0% 44
Brazil Brazil 0.303 +1% 8
Brunei Brunei 0.0018 0% 51
Canada Canada 0.107 -3.35% 14
Switzerland Switzerland 0.0085 -1.16% 38
Chile Chile 0.0088 +3.53% 36
China China 3.64 +2.18% 2
Congo - Brazzaville Congo - Brazzaville 0 68
Colombia Colombia 0.0189 +1.07% 25
Cuba Cuba 0.0005 0% 63
Czechia Czechia 0.0563 -0.53% 16
Germany Germany 0.0309 -31% 23
Dominica Dominica 0.0001 0% 67
Denmark Denmark 0.001 0% 58
Dominican Republic Dominican Republic 0.0005 0% 63
Algeria Algeria 0.0024 +4.35% 46
Ecuador Ecuador 0.0047 +2.17% 40
Egypt Egypt 0.0005 +25% 63
Spain Spain 4.18 +2.53% 1
Estonia Estonia 0.0001 0% 67
Ethiopia Ethiopia 0.0016 0% 53
France France 2.33 +0.699% 4
Faroe Islands Faroe Islands 0.002 0% 50
Gabon Gabon 0.0003 0% 65
United Kingdom United Kingdom 0.0543 -2.69% 17
Gibraltar Gibraltar 0.0006 0% 62
Greece Greece 0.0017 -10.5% 52
Greenland Greenland 0.0011 0% 57
Guyana Guyana 0.0001 0% 67
Hong Kong SAR China Hong Kong SAR China 0.0112 +0.901% 33
Honduras Honduras 0.0334 +2.45% 22
Croatia Croatia 0 68
Hungary Hungary 0.0188 +1.62% 26
Indonesia Indonesia 0.174 +2.11% 11
Ireland Ireland 0.0087 -8.42% 37
Iceland Iceland 0.0007 0% 61
Italy Italy 0.405 -2.24% 7
Jamaica Jamaica 0.0007 0% 61
Jordan Jordan 0.0002 0% 66
Japan Japan 3.22 -1.63% 3
Kenya Kenya 0.0015 +7.14% 54
Cambodia Cambodia 0.013 +3.17% 29
South Korea South Korea 1.61 +0.0186% 5
Kuwait Kuwait 0.0004 0% 64
Laos Laos 0.0158 +3.27% 28
Lebanon Lebanon 0 68
St. Lucia St. Lucia 0 68
Lithuania Lithuania 0.0025 +13.6% 45
Macao SAR China Macao SAR China 0.0009 0% 59
Moldova Moldova 0.0024 0% 46
Maldives Maldives 0.0038 +2.7% 41
Mexico Mexico 0.506 +1.48% 6
North Macedonia North Macedonia 0.02 +0.503% 24
Mali Mali 0.011 +4.76% 34
Malta Malta 0.0003 0% 65
Myanmar (Burma) Myanmar (Burma) 0.047 +1.51% 20
Mongolia Mongolia 0.0009 0% 59
Mauritius Mauritius 0.0001 0% 67
Malaysia Malaysia 0.078 +1.96% 15
Netherlands Netherlands 0 68
Norway Norway 0.0512 -7.91% 19
New Zealand New Zealand 0.0021 -4.55% 49
Peru Peru 0.0097 +2.11% 35
Philippines Philippines 0.154 +1.92% 13
Palau Palau 0 68
Papua New Guinea Papua New Guinea 0.001 0% 58
Poland Poland 0.196 -0.557% 10
North Korea North Korea 0.0112 +0.901% 33
Portugal Portugal 0.205 +1.53% 9
Paraguay Paraguay 0.0001 0% 67
Qatar Qatar 0 68
Romania Romania 0.0047 -4.08% 40
Singapore Singapore 0.042 +1.2% 21
Suriname Suriname 0.0002 0% 66
Slovakia Slovakia 0 68
Slovenia Slovenia 0.0049 -10.9% 39
Sweden Sweden 0.156 -0.256% 12
Togo Togo 0.0002 0% 66
Thailand Thailand 0.0189 +1.61% 25
Timor-Leste Timor-Leste 0.0002 0% 66
Turkey Turkey 0.0022 +15.8% 48
Ukraine Ukraine 0.0128 +4.07% 30
Uruguay Uruguay 0.0014 0% 55
United States United States 0.0034 0% 42
St. Vincent & Grenadines St. Vincent & Grenadines 0 68
Venezuela Venezuela 0.0179 +1.13% 27
Vietnam Vietnam 0.052 +2.77% 18

                    
# Install missing packages
import sys
import subprocess

def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])

# Required packages
for package in ['wbdata', 'country_converter']:
try:
__import__(package)
except ImportError:
install(package)

# Import libraries
import wbdata
import country_converter as coco
from datetime import datetime

# Define World Bank indicator code
dataset_code = 'EN.GHG.CO2.WA.MT.CE.AR5'

# Download data from World Bank API
data = wbdata.get_dataframe({dataset_code: 'value'},
date=(datetime(1960, 1, 1), datetime.today()),
parse_dates=True,
keep_levels=True).reset_index()

# Extract year
data['year'] = data['date'].dt.year

# Convert country names to ISO codes using country_converter
cc = coco.CountryConverter()
data['iso2c'] = cc.convert(names=data['country'], to='ISO2', not_found=None)
data['iso3c'] = cc.convert(names=data['country'], to='ISO3', not_found=None)

# Filter out rows where ISO codes could not be matched — likely not real countries
data = data[data['iso2c'].notna() & data['iso3c'].notna()]

# Sort for calculation
data = data.sort_values(['iso3c', 'year'])

# Calculate YoY absolute and percent change
data['value_change'] = data.groupby('iso3c')['value'].diff()
data['value_change_percent'] = data.groupby('iso3c')['value'].pct_change() * 100

# Calculate ranks (higher GDP per capita = better rank)
data['rank'] = data.groupby('year')['value'].rank(ascending=False, method='dense')

# Calculate rank change from previous year
data['rank_change'] = data.groupby('iso3c')['rank'].diff()

# Select desired columns
final_df = data[['country', 'iso2c', 'iso3c', 'year', 'value',
'value_change', 'value_change_percent', 'rank', 'rank_change']].copy()

# Optional: Add labels as metadata (could be useful for export or UI)
column_labels = {
'country': 'Country name',
'iso2c': 'ISO 2-letter country code',
'iso3c': 'ISO 3-letter country code',
'year': 'Year',
'value': 'GDP per capita (current US$)',
'value_change': 'Year-over-Year change in value',
'value_change_percent': 'Year-over-Year percent change in value',
'rank': 'Country rank by GDP per capita (higher = richer)',
'rank_change': 'Change in rank from previous year'
}

# Display first few rows
print(final_df.head(10))

# Optional: Save to CSV
#final_df.to_csv("gdp_per_capita_cleaned.csv", index=False)
                    
                
                    
# Check and install required packages
required_packages <- c("WDI", "countrycode", "dplyr")

for (pkg in required_packages) {
  if (!requireNamespace(pkg, quietly = TRUE)) {
    install.packages(pkg)
  }
}

# Load the necessary libraries
library(WDI)
library(dplyr)
library(countrycode)

# Define the dataset code (World Bank indicator code)
dataset_code <- 'EN.GHG.CO2.WA.MT.CE.AR5'

# Download data using WDI package
dat <- WDI(indicator = dataset_code)

# Filter only countries using 'is_country' from countrycode
# This uses iso2c to identify whether the entry is a recognized country
dat <- dat %>%
  filter(countrycode(iso2c, origin = 'iso2c', destination = 'country.name', warn = FALSE) %in%
           countrycode::codelist$country.name.en)

# Ensure dataset is ordered by country and year
dat <- dat %>%
  arrange(iso3c, year)

# Rename the dataset_code column to "value" for easier manipulation
dat <- dat %>%
  rename(value = !!dataset_code)

# Calculate year-over-year (YoY) change and percentage change
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(
    value_change = value - lag(value),                              # Absolute change from previous year
    value_change_percent = 100 * (value - lag(value)) / lag(value) # Percent change from previous year
  ) %>%
  ungroup()

# Calculate rank by year (higher value => higher rank)
dat <- dat %>%
  group_by(year) %>%
  mutate(rank = dense_rank(desc(value))) %>% # Rank countries by descending value
  ungroup()

# Calculate rank change (positive = moved up, negative = moved down)
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(rank_change = rank - lag(rank)) %>% # Change in rank compared to previous year
  ungroup()

# Select and reorder final columns
final_data <- dat %>%
  select(
    country,
    iso2c,
    iso3c,
    year,
    value,
    value_change,
    value_change_percent,
    rank,
    rank_change
  )

# Add labels (variable descriptions)
attr(final_data$country, "label") <- "Country name"
attr(final_data$iso2c, "label") <- "ISO 2-letter country code"
attr(final_data$iso3c, "label") <- "ISO 3-letter country code"
attr(final_data$year, "label") <- "Year"
attr(final_data$value, "label") <- "GDP per capita (current US$)"
attr(final_data$value_change, "label") <- "Year-over-Year change in value"
attr(final_data$value_change_percent, "label") <- "Year-over-Year percent change in value"
attr(final_data$rank, "label") <- "Country rank by GDP per capita (higher = richer)"
attr(final_data$rank_change, "label") <- "Change in rank from previous year"

# Print the first few rows of the final dataset
print(head(final_data, 10))