Monetary Sector credit to private sector (% GDP)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 8.08 -4.13% 124
Albania Albania 31.4 +5% 85
United Arab Emirates United Arab Emirates 69.9 +4.08% 29
Argentina Argentina 13.2 +10.8% 117
Armenia Armenia 64.6 +16.5% 36
Antigua & Barbuda Antigua & Barbuda 38.3 +0.638% 68
Australia Australia 130 +1.76% 5
Austria Austria 83.8 -1.29% 20
Azerbaijan Azerbaijan 24.5 +10.8% 98
Belgium Belgium 68.8 -1.71% 31
Benin Benin 19 +2% 109
Burkina Faso Burkina Faso 27 -14.5% 93
Bangladesh Bangladesh 35.8 -4.86% 75
Bulgaria Bulgaria 47.5 +5.1% 59
Bosnia & Herzegovina Bosnia & Herzegovina 46.2 +6.3% 63
Belize Belize 37.6 -10.1% 69
Bolivia Bolivia 65.5 -6.26% 35
Brazil Brazil 75.8 +6.7% 26
Brunei Brunei 36.3 +1.12% 72
Botswana Botswana 32.9 +9.55% 81
Chile Chile 74.9 -6.21% 27
China China 194 +2.4% 2
Côte d’Ivoire Côte d’Ivoire 22.7 +2% 103
Colombia Colombia 39.6 -5.04% 66
Costa Rica Costa Rica 51 +1.75% 52
Cyprus Cyprus 58.7 -6.39% 41
Czechia Czechia 48.3 +0.686% 57
Djibouti Djibouti 23.5 +8.08% 100
Dominica Dominica 39.4 -5.71% 67
Denmark Denmark 142 -2.84% 3
Dominican Republic Dominican Republic 31 +3.71% 87
Algeria Algeria 19.4 +3.05% 108
Ecuador Ecuador 54.6 +3.6% 47
Egypt Egypt 27.6 -5.77% 91
Spain Spain 74.3 -5.08% 28
Estonia Estonia 61.1 +5.42% 38
Finland Finland 91.7 -1.72% 17
Fiji Fiji 77.7 +2.89% 24
France France 108 -4.62% 15
United Kingdom United Kingdom 114 -4.84% 13
Georgia Georgia 66.2 +4.47% 34
Guinea-Bissau Guinea-Bissau 11.1 -11.6% 121
Greece Greece 48.4 -1.5% 56
Grenada Grenada 54.1 +5.08% 49
Guatemala Guatemala 36.3 -0.936% 73
Guyana Guyana 10.4 -18.7% 123
Hong Kong SAR China Hong Kong SAR China 231 -7.12% 1
Honduras Honduras 76.5 +3.35% 25
Croatia Croatia 47.1 -0.0513% 60
Haiti Haiti 4.11 -20.4% 126
Hungary Hungary 32.4 -1.04% 82
Indonesia Indonesia 31.8 +1.59% 84
Ireland Ireland 25.1 -3.31% 97
Iraq Iraq 14 +11.2% 114
Iceland Iceland 90.3 +1.52% 18
Italy Italy 60.6 -4.54% 39
Jamaica Jamaica 49.9 +1.44% 54
Jordan Jordan 80.2 -2.03% 22
Japan Japan 124 +0.452% 9
Kazakhstan Kazakhstan 25.8 +6.85% 95
Kyrgyzstan Kyrgyzstan 23.2 +16.1% 101
Cambodia Cambodia 125 -4.2% 7
St. Kitts & Nevis St. Kitts & Nevis 67 +8.74% 33
Kuwait Kuwait 4.4 -4.15% 125
Libya Libya 13.6 +13.7% 115
St. Lucia St. Lucia 50.7 +0.193% 53
Lesotho Lesotho 25.6 +2.88% 96
Lithuania Lithuania 36 +4.6% 74
Luxembourg Luxembourg 85.2 -9.82% 19
Latvia Latvia 29.7 +3.3% 89
Macao SAR China Macao SAR China 128 -12.5% 6
Morocco Morocco 57 -2.31% 45
Moldova Moldova 24.3 +17.2% 99
Madagascar Madagascar 16.6 -2.73% 112
Maldives Maldives 32 +0.706% 83
Mexico Mexico 26.6 +5.03% 94
North Macedonia North Macedonia 52 +4.32% 51
Mali Mali 22.6 -3.39% 105
Malta Malta 63.6 -2.73% 37
Montenegro Montenegro 46.4 +7.84% 62
Mozambique Mozambique 17.9 -3.41% 110
Mauritius Mauritius 69.8 +0.0673% 30
Malaysia Malaysia 116 -0.854% 11
Namibia Namibia 48.3 -3.34% 58
Niger Niger 10.4 -6.19% 122
Nicaragua Nicaragua 29.1 +8.58% 90
Netherlands Netherlands 81.5 -3.08% 21
Norway Norway 110 +1.4% 14
Nepal Nepal 92.1 +0.605% 16
New Zealand New Zealand 130 +0.0422% 4
Pakistan Pakistan 11.4 -4.66% 120
Philippines Philippines 49.8 +3.11% 55
Poland Poland 33.7 -2.91% 78
Portugal Portugal 78.4 -3.2% 23
Paraguay Paraguay 57.5 +9.81% 44
Palestinian Territories Palestinian Territories 68.5 +24.5% 32
Qatar Qatar 120 +1.65% 10
Romania Romania 22.7 -1.45% 102
Rwanda Rwanda 22.6 +1.14% 104
Senegal Senegal 29.7 -5.49% 88
Solomon Islands Solomon Islands 19.5 -1.71% 107
Sierra Leone Sierra Leone 3.66 +13.2% 127
El Salvador El Salvador 53.1 +1.31% 50
Somalia Somalia 0.000188 +2.3% 128
Serbia Serbia 33 -0.111% 80
Suriname Suriname 15.9 -4.41% 113
Slovakia Slovakia 59.3 -3.29% 40
Slovenia Slovenia 35.7 -2.04% 76
Sweden Sweden 124 -2.74% 8
Eswatini Eswatini 21.5 +0.416% 106
Togo Togo 27.2 -2.43% 92
Thailand Thailand 115 -3.18% 12
Timor-Leste Timor-Leste 34.5 +45.7% 77
Trinidad & Tobago Trinidad & Tobago 46.9 +4.93% 61
Tunisia Tunisia 58.3 -7.15% 42
Turkey Turkey 37 -14.7% 70
Tanzania Tanzania 16.8 +2.25% 111
Uganda Uganda 12.6 -2.74% 118
Ukraine Ukraine 13.4 -2.88% 116
Uruguay Uruguay 31.1 +8.76% 86
United States United States 46.1 -6.08% 64
Uzbekistan Uzbekistan 33.2 -3.37% 79
St. Vincent & Grenadines St. Vincent & Grenadines 36.7 -7.66% 71
Vanuatu Vanuatu 54.2 +2.22% 48
Samoa Samoa 41.3 -6.93% 65
Kosovo Kosovo 55.9 +10.6% 46
South Africa South Africa 57.6 -0.046% 43
Zambia Zambia 12.5 -2.49% 119

                    
# 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.AST.PRVT.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.AST.PRVT.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))