Broad money (% of GDP)

Source: worldbank.org, 01.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 20.2 -19.7% 85
United Arab Emirates United Arab Emirates 117 +9.67% 14
Argentina Argentina 26.5 -26.3% 82
Armenia Armenia 58.2 +6.09% 53
Antigua & Barbuda Antigua & Barbuda 75.6 -5.69% 31
Australia Australia 130 +2.38% 8
Azerbaijan Azerbaijan 36.8 +0.534% 77
Benin Benin 28.1 -7.12% 80
Burkina Faso Burkina Faso 42.1 -6.56% 71
Bangladesh Bangladesh 48.8 -4.73% 65
Bulgaria Bulgaria 83 -0.712% 26
Belize Belize 69.2 -4.6% 39
Brazil Brazil 117 +5.95% 15
Brunei Brunei 83 +1.7% 25
Botswana Botswana 43.8 +5.11% 69
Chile Chile 75.1 -11.5% 32
China China 227 +2.47% 3
Côte d’Ivoire Côte d’Ivoire 37.8 +4.57% 76
Costa Rica Costa Rica 50.5 +6.51% 63
Czechia Czechia 87.6 +2.1% 22
Dominica Dominica 77.2 -1.12% 29
Denmark Denmark 61.8 -3.94% 44
Dominican Republic Dominican Republic 39.4 +1.69% 74
Algeria Algeria 75.1 +3.79% 33
Ecuador Ecuador 57.1 +9.26% 54
Egypt Egypt 83.7 -4.25% 24
United Kingdom United Kingdom 144 -2.49% 5
Georgia Georgia 53.8 +0.774% 58
Guinea-Bissau Guinea-Bissau 40.8 +4.16% 73
Grenada Grenada 92.7 +3.18% 20
Guatemala Guatemala 56.9 +0.715% 55
Guyana Guyana 24.4 -16.5% 83
Hong Kong SAR China Hong Kong SAR China 454 +0.483% 1
Honduras Honduras 74.9 +0.799% 34
Hungary Hungary 60 +1.4% 48
Indonesia Indonesia 41.8 -1.14% 72
Iraq Iraq 47.9 -6.34% 66
Iceland Iceland 66.8 +4.96% 42
Jamaica Jamaica 67.4 +3.8% 41
Jordan Jordan 115 +1.59% 16
Japan Japan 267 -2.74% 2
Kazakhstan Kazakhstan 33.8 +5.28% 78
Cambodia Cambodia 120 +8.35% 13
St. Kitts & Nevis St. Kitts & Nevis 109 +1.54% 17
Kuwait Kuwait 82.7 +7.79% 27
St. Lucia St. Lucia 66.7 +5.67% 43
Macao SAR China Macao SAR China 194 -1.25% 4
Morocco Morocco 123 +2.94% 11
Moldova Moldova 52.4 +6.62% 61
Maldives Maldives 55.1 -5.59% 56
Mexico Mexico 45.9 +6.91% 67
North Macedonia North Macedonia 61.5 +4.26% 45
Mali Mali 29.8 -5.74% 79
Montenegro Montenegro 58.3 +2.6% 52
Mauritius Mauritius 140 +3.62% 7
Malaysia Malaysia 121 -2.51% 12
Niger Niger 16.7 -8.58% 87
Norway Norway 61.4 +1.53% 46
Nepal Nepal 126 +4.56% 10
New Zealand New Zealand 100 +0.642% 18
Pakistan Pakistan 38.1 -10.6% 75
Poland Poland 68 +2.46% 40
Paraguay Paraguay 52.6 +3.73% 60
Palestinian Territories Palestinian Territories 129 +39.4% 9
Rwanda Rwanda 27.7 +5.11% 81
Senegal Senegal 52.2 -1.16% 62
Solomon Islands Solomon Islands 43 -2.97% 70
El Salvador El Salvador 58.8 -1.1% 50
Serbia Serbia 53.6 +3.85% 59
Suriname Suriname 58.3 -10.8% 51
Sweden Sweden 77.1 -3.36% 30
Seychelles Seychelles 85.2 +4.58% 23
Togo Togo 50.2 +0.433% 64
Thailand Thailand 142 -0.102% 6
Tonga Tonga 73 +1.06% 36
Trinidad & Tobago Trinidad & Tobago 70.7 -2.13% 38
Tunisia Tunisia 80 -0.558% 28
Uganda Uganda 20.9 -3.7% 84
Ukraine Ukraine 45.5 -1.89% 68
Uruguay Uruguay 55.1 +7.84% 57
United States United States 99.2 +0.0997% 19
Uzbekistan Uzbekistan 19 +8.18% 86
St. Vincent & Grenadines St. Vincent & Grenadines 71.4 +7.3% 37
Vanuatu Vanuatu 92.7 +6.22% 21
Samoa Samoa 60.1 -5.24% 47
Kosovo Kosovo 59.9 +5.59% 49
South Africa South Africa 74 +2.17% 35

                    
# 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 = 'FM.LBL.BMNY.GD.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 <- 'FM.LBL.BMNY.GD.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))