Adjusted savings: mineral depletion (% of GNI)

Source: worldbank.org, 03.09.2025

Year: 2021

Flag Country Value Value change, % Rank
Aruba Aruba 0 88
Afghanistan Afghanistan 0 88
Angola Angola 0 88
Albania Albania 0.0634 +363% 65
Argentina Argentina 0.457 +163% 50
Armenia Armenia 3.33 +296% 21
Antigua & Barbuda Antigua & Barbuda 0 88
Australia Australia 4.47 +148% 18
Austria Austria 0 88
Azerbaijan Azerbaijan 0.26 +49.5% 55
Burundi Burundi 0 88
Belgium Belgium 0 88
Benin Benin 0 88
Burkina Faso Burkina Faso 12.6 +265% 4
Bangladesh Bangladesh 0 88
Bulgaria Bulgaria 0.474 +76.5% 49
Bahamas Bahamas 0 88
Bosnia & Herzegovina Bosnia & Herzegovina 0.0317 +43.5% 72
Belarus Belarus 0 88
Belize Belize 0 88
Bermuda Bermuda 0 88
Bolivia Bolivia 4.65 +1,280% 15
Brazil Brazil 1.48 +307% 32
Barbados Barbados 0 88
Brunei Brunei 0 88
Bhutan Bhutan 0.00655 +16.8% 81
Botswana Botswana 0.19 +265% 58
Central African Republic Central African Republic 0.557 +324% 46
Canada Canada 0.79 +482% 42
Switzerland Switzerland 0 88
Chile Chile 9.41 +252% 6
China China 0.322 +184% 52
Côte d’Ivoire Côte d’Ivoire 1.89 +245% 28
Cameroon Cameroon 0 88
Congo - Kinshasa Congo - Kinshasa 22.7 +388% 1
Congo - Brazzaville Congo - Brazzaville 0 88
Colombia Colombia 0.671 +169% 44
Comoros Comoros 0 88
Cape Verde Cape Verde 0 88
Costa Rica Costa Rica 0 88
Curaçao Curaçao 0 88
Cyprus Cyprus 0.0101 +78.4% 78
Czechia Czechia 0 88
Germany Germany 0 -100% 88
Djibouti Djibouti 0 88
Dominica Dominica 0 88
Denmark Denmark 0 88
Dominican Republic Dominican Republic 1.42 +76.4% 33
Algeria Algeria 0.00298 +97% 84
Ecuador Ecuador 0 88
Egypt Egypt 0 88
Spain Spain 0.0384 +354% 69
Estonia Estonia 0 88
Ethiopia Ethiopia 0.206 +228% 57
Finland Finland 0.0491 +480% 67
Fiji Fiji 0.927 +145% 39
France France 0 88
Faroe Islands Faroe Islands 0 88
Micronesia (Federated States of) Micronesia (Federated States of) 0 88
Gabon Gabon 0.0207 +235% 74
United Kingdom United Kingdom 0.00004 +110% 87
Georgia Georgia 1.06 +66.1% 37
Ghana Ghana 4.36 +125% 19
Guinea Guinea 0 88
Gambia Gambia 0 88
Guinea-Bissau Guinea-Bissau 0 88
Equatorial Guinea Equatorial Guinea 0 88
Greece Greece 0.0361 +286% 71
Grenada Grenada 0 88
Guatemala Guatemala 0.537 +170% 48
Guyana Guyana 7.64 +282% 9
Hong Kong SAR China Hong Kong SAR China 0 88
Honduras Honduras 0.323 +53,469% 51
Croatia Croatia 0 88
Haiti Haiti 0 88
Hungary Hungary 0 88
Indonesia Indonesia 1.25 +328% 35
India India 0.946 +112% 38
Ireland Ireland 0.0368 +196% 70
Iran Iran 1.69 +180% 31
Iraq Iraq 0 88
Iceland Iceland 0 88
Israel Israel 0 88
Italy Italy 0 88
Jamaica Jamaica 0 88
Jordan Jordan 0 88
Japan Japan 0.00538 -77.3% 82
Kazakhstan Kazakhstan 6.51 +120% 12
Kenya Kenya 0.00446 +228% 83
Kyrgyzstan Kyrgyzstan 9.22 +94.2% 7
Cambodia Cambodia 0 88
Kiribati Kiribati 0 88
St. Kitts & Nevis St. Kitts & Nevis 0 88
South Korea South Korea 0.000372 -98.7% 86
Laos Laos 1.85 +211% 29
Lebanon Lebanon 0 88
Liberia Liberia 4.48 17
Libya Libya 0 88
St. Lucia St. Lucia 0 88
Sri Lanka Sri Lanka 0 88
Lesotho Lesotho 0 88
Lithuania Lithuania 0 88
Luxembourg Luxembourg 0 88
Latvia Latvia 0 88
Macao SAR China Macao SAR China 0 88
Morocco Morocco 0.123 +58.7% 61
Moldova Moldova 0 88
Madagascar Madagascar 0 88
Maldives Maldives 0 88
Mexico Mexico 0.845 +215% 41
Marshall Islands Marshall Islands 0 88
North Macedonia North Macedonia 0 88
Mali Mali 13.2 +138% 3
Malta Malta 0 88
Myanmar (Burma) Myanmar (Burma) 0.759 +285% 43
Montenegro Montenegro 0.0109 -9.46% 76
Mongolia Mongolia 11.5 +263% 5
Mozambique Mozambique 0.111 +249% 63
Mauritania Mauritania 6.61 +2,366% 11
Mauritius Mauritius 0 88
Malawi Malawi 0.000471 +53.1% 85
Malaysia Malaysia 0 88
Namibia Namibia 2.18 +220% 27
Niger Niger 0.632 +293% 45
Nigeria Nigeria 0.00683 +56.7% 80
Nicaragua Nicaragua 2.22 +5,527% 26
Netherlands Netherlands 0 88
Norway Norway 0 88
Nepal Nepal 0 88
Nauru Nauru 0 88
New Zealand New Zealand 0.0758 +159% 64
Oman Oman 0 88
Pakistan Pakistan 0.0222 +98% 73
Panama Panama 1.33 +800% 34
Peru Peru 7.22 +286% 10
Philippines Philippines 1.13 +301% 36
Palau Palau 0 88
Papua New Guinea Papua New Guinea 9.15 +348% 8
Poland Poland 0.175 +193% 59
Puerto Rico Puerto Rico 0 88
Portugal Portugal 0.116 +88.7% 62
Paraguay Paraguay 0 88
Palestinian Territories Palestinian Territories 0 88
Qatar Qatar 0 88
Romania Romania 0.0161 +146% 75
Russia Russia 0.895 +87.1% 40
Rwanda Rwanda 0 88
Sudan Sudan 5.35 +69.5% 14
Senegal Senegal 2.29 +139% 25
Singapore Singapore 0 88
Solomon Islands Solomon Islands 0 88
Sierra Leone Sierra Leone 0.167 +5,197% 60
El Salvador El Salvador 0 88
Somalia Somalia 0 88
Serbia Serbia 0.238 +256% 56
São Tomé & Príncipe São Tomé & Príncipe 0 88
Suriname Suriname 0 88
Slovakia Slovakia 0.00922 +41.2% 79
Slovenia Slovenia 0 88
Sweden Sweden 0.556 +417% 47
Eswatini Eswatini 0 88
Seychelles Seychelles 0 88
Turks & Caicos Islands Turks & Caicos Islands 0 88
Chad Chad 0 88
Togo Togo 3.77 +219% 20
Thailand Thailand 0 88
Tajikistan Tajikistan 4.49 +88.1% 16
Timor-Leste Timor-Leste 0 88
Tonga Tonga 0 88
Trinidad & Tobago Trinidad & Tobago 0 88
Tunisia Tunisia 0 88
Turkey Turkey 0.28 +171% 54
Tuvalu Tuvalu 0 88
Tanzania Tanzania 3.13 +243% 22
Uganda Uganda 0 88
Ukraine Ukraine 1.74 +4,747% 30
Uruguay Uruguay 0.0103 77
United States United States 0.0606 +319% 66
Uzbekistan Uzbekistan 5.54 +18.6% 13
St. Vincent & Grenadines St. Vincent & Grenadines 0 88
Vietnam Vietnam 0.0405 +358% 68
Vanuatu Vanuatu 0 88
Samoa Samoa 0 88
Kosovo Kosovo 0.296 +126% 53
South Africa South Africa 2.65 +159% 24
Zambia Zambia 21 +276% 2
Zimbabwe Zimbabwe 3.07 +79.3% 23

                    
# 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 = 'NY.ADJ.DMIN.GN.ZS'

# 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 <- 'NY.ADJ.DMIN.GN.ZS'

# 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))