Insurance and financial services (% of commercial service imports)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 7.58 +0.58% 50
Albania Albania 3.6 -16.1% 88
Argentina Argentina 3.65 -1.98% 86
Armenia Armenia 9.29 +9.69% 39
Antigua & Barbuda Antigua & Barbuda 10.6 -0.887% 28
Australia Australia 2.67 +1.12% 100
Austria Austria 3.92 -3% 84
Azerbaijan Azerbaijan 3.11 -2.29% 93
Belgium Belgium 8.34 +0.62% 47
Bangladesh Bangladesh 7.77 -7.04% 49
Bulgaria Bulgaria 8.46 +9.2% 46
Bahrain Bahrain 35 -1.22% 2
Bahamas Bahamas 12.7 -7.31% 20
Bosnia & Herzegovina Bosnia & Herzegovina 7.05 +10.7% 55
Belize Belize 13.2 +20.9% 18
Brazil Brazil 4.66 +3.9% 73
Brunei Brunei 2.68 -22.1% 99
Bhutan Bhutan 11.4 +42.2% 25
Canada Canada 8.91 +2.18% 43
Switzerland Switzerland 3.43 -4.49% 90
Chile Chile 11.5 -8.19% 24
China China 2.97 -20.2% 95
Colombia Colombia 10.5 +1.49% 30
Cape Verde Cape Verde 4.16 +20.1% 81
Costa Rica Costa Rica 11.2 -6.62% 26
Cyprus Cyprus 19.8 +2.87% 3
Czechia Czechia 6.78 -6.66% 59
Germany Germany 7.52 -0.865% 51
Djibouti Djibouti 2.69 -23.5% 98
Dominica Dominica 16.6 -2.86% 11
Denmark Denmark 1.67 -11.3% 109
Dominican Republic Dominican Republic 12.2 -8.07% 21
Ecuador Ecuador 13.1 +11.7% 19
Spain Spain 4.56 -6.87% 74
Estonia Estonia 2.53 +2.63% 103
Finland Finland 4.5 +20.4% 77
France France 9.79 +9.19% 36
United Kingdom United Kingdom 9.97 -0.426% 35
Georgia Georgia 7.51 +8.18% 52
Gambia Gambia 19.8 +9.2% 4
Greece Greece 8.93 -4.32% 42
Grenada Grenada 8.94 -5.45% 41
Guatemala Guatemala 10.9 -8.91% 27
Hong Kong SAR China Hong Kong SAR China 11.9 -4.62% 23
Honduras Honduras 6.92 +10.8% 56
Croatia Croatia 5.3 +36.5% 71
Hungary Hungary 4.18 -9.56% 80
Indonesia Indonesia 10.3 +0.289% 34
India India 3.82 -7.42% 85
Iceland Iceland 5.31 +5.26% 70
Israel Israel 1.62 +20.4% 110
Italy Italy 9.61 -0.0665% 38
Jamaica Jamaica 6.29 +19.4% 62
Japan Japan 13.5 +10.4% 17
Kazakhstan Kazakhstan 5.68 +12.2% 68
Cambodia Cambodia 9.18 +11.7% 40
St. Kitts & Nevis St. Kitts & Nevis 17.7 +26.2% 6
South Korea South Korea 3.59 -11.5% 89
Kuwait Kuwait 10.3 -7.21% 33
St. Lucia St. Lucia 7.87 -2.25% 48
Lesotho Lesotho 2.6 +0.026% 101
Lithuania Lithuania 4.26 -0.322% 78
Luxembourg Luxembourg 44.8 +2.56% 1
Latvia Latvia 2.28 -31.3% 105
Moldova Moldova 2.53 -2.65% 102
Maldives Maldives 7.32 +27.7% 53
Mexico Mexico 17.5 +5.19% 7
North Macedonia North Macedonia 1.27 -17.1% 111
Malta Malta 2.5 -11.9% 104
Montenegro Montenegro 1.81 +49.4% 106
Mozambique Mozambique 6.78 -15.3% 58
Malaysia Malaysia 5.91 -4.21% 66
Namibia Namibia 1.79 +4.63% 107
Nigeria Nigeria 8.59 +41.3% 45
Nicaragua Nicaragua 16.3 -1.1% 12
Netherlands Netherlands 5.97 -0.3% 65
Norway Norway 3.95 -1.21% 83
Nepal Nepal 4.5 +1.46% 76
New Zealand New Zealand 13.8 +7.91% 16
Pakistan Pakistan 9.71 +2.38% 37
Panama Panama 19.3 +9.8% 5
Peru Peru 10.4 +1.53% 31
Philippines Philippines 12.1 -0.582% 22
Poland Poland 5.26 -0.212% 72
Portugal Portugal 5.47 -5.73% 69
Paraguay Paraguay 6.39 -12.9% 60
Palestinian Territories Palestinian Territories 5.75 +38.8% 67
Qatar Qatar 4.02 +19.7% 82
Romania Romania 3.4 -7.42% 91
Russia Russia 1.76 +4.6% 108
Saudi Arabia Saudi Arabia 6.3 -10.8% 61
Singapore Singapore 7.22 +5.62% 54
Solomon Islands Solomon Islands 4.19 -19.5% 79
El Salvador El Salvador 16.7 +2.62% 10
Suriname Suriname 8.69 +33.8% 44
Slovakia Slovakia 4.54 +3.17% 75
Slovenia Slovenia 3.62 +7.57% 87
Sweden Sweden 2.71 -3.38% 97
Thailand Thailand 6.79 -7.93% 57
Tajikistan Tajikistan 13.8 +79.9% 15
Timor-Leste Timor-Leste 10.3 +30.4% 32
Tonga Tonga 2.84 +21.6% 96
Trinidad & Tobago Trinidad & Tobago 17.1 +1.66% 9
Turkey Turkey 10.6 +17.2% 29
Ukraine Ukraine 3.01 +6.1% 94
Uruguay Uruguay 6.06 +4.17% 64
United States United States 17.2 -2.19% 8
Uzbekistan Uzbekistan 3.33 -22.1% 92
St. Vincent & Grenadines St. Vincent & Grenadines 14 +3.77% 14
Samoa Samoa 14.9 +56.1% 13
South Africa South Africa 6.08 +37.8% 63

                    
# 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 = 'TM.VAL.INSF.ZS.WT'

# 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 <- 'TM.VAL.INSF.ZS.WT'

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