Transport services (% of commercial service imports)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 37.3 +10.9% 28
Albania Albania 10.5 -15.2% 110
Argentina Argentina 21.1 -13.1% 75
Armenia Armenia 32.7 +2.56% 39
Antigua & Barbuda Antigua & Barbuda 21.5 -5.2% 72
Australia Australia 17 -5.06% 96
Austria Austria 24.3 -3.36% 62
Azerbaijan Azerbaijan 18.6 -9.05% 87
Belgium Belgium 19 -2.57% 86
Bangladesh Bangladesh 63.8 +1.73% 5
Bulgaria Bulgaria 28.9 -2.03% 47
Bahrain Bahrain 33.4 -1.15% 36
Bahamas Bahamas 24.3 -6.42% 61
Bosnia & Herzegovina Bosnia & Herzegovina 33.8 -7.95% 35
Belize Belize 39.2 +0.434% 25
Brazil Brazil 22.3 -0.816% 68
Brunei Brunei 17.3 -4.41% 94
Bhutan Bhutan 21.6 -19.1% 71
Canada Canada 17.4 +1.48% 93
Switzerland Switzerland 15.9 +3.86% 102
Chile Chile 36 +0.928% 31
China China 27.6 -7.6% 48
Colombia Colombia 25.1 +1.32% 59
Cape Verde Cape Verde 28.9 -10% 46
Costa Rica Costa Rica 23.4 -1.93% 64
Cyprus Cyprus 17 -6.65% 95
Czechia Czechia 22 -6.77% 69
Germany Germany 20 -2.7% 80
Djibouti Djibouti 91.9 +1.05% 1
Dominica Dominica 23 -9.51% 65
Denmark Denmark 40.6 -1.29% 21
Dominican Republic Dominican Republic 45.8 -4.07% 14
Ecuador Ecuador 35.4 +2.76% 32
Spain Spain 12.7 +9.89% 107
Estonia Estonia 26.5 -2.04% 56
Finland Finland 16.5 -3.8% 101
France France 18 -3.4% 91
United Kingdom United Kingdom 9.13 -16.1% 111
Georgia Georgia 60.5 -3.65% 6
Gambia Gambia 66.7 -9.96% 3
Greece Greece 63.9 -3.21% 4
Grenada Grenada 21.7 -3.26% 70
Guatemala Guatemala 46.4 +2.5% 13
Hong Kong SAR China Hong Kong SAR China 22.9 +0.74% 66
Honduras Honduras 54.6 -2.76% 8
Croatia Croatia 14.6 +0.257% 105
Hungary Hungary 27.1 -3.32% 51
Indonesia Indonesia 24.9 -1.87% 60
India India 17.6 +5.96% 92
Iceland Iceland 18.1 -3.1% 90
Israel Israel 16.8 -9.88% 100
Italy Italy 21.2 +4.2% 74
Jamaica Jamaica 47.1 -1.33% 11
Japan Japan 14.9 -1.47% 104
Kazakhstan Kazakhstan 25.9 -9.12% 57
Cambodia Cambodia 49.7 +2.78% 10
St. Kitts & Nevis St. Kitts & Nevis 29.2 +29.9% 45
South Korea South Korea 22.4 -0.878% 67
Kuwait Kuwait 20.8 +4.58% 77
St. Lucia St. Lucia 26.6 +2.78% 54
Lesotho Lesotho 12.5 +1.47% 109
Lithuania Lithuania 46.5 +0.409% 12
Luxembourg Luxembourg 16.9 -1.36% 98
Latvia Latvia 24.2 -4.63% 63
Moldova Moldova 39.9 +1.31% 23
Maldives Maldives 26.6 -10.3% 55
Mexico Mexico 35.2 -8.11% 33
North Macedonia North Macedonia 26.9 +8.36% 52
Malta Malta 18.5 +2.5% 89
Montenegro Montenegro 53.2 -9.42% 9
Mozambique Mozambique 38.1 -12% 26
Malaysia Malaysia 25.7 -1.97% 58
Namibia Namibia 13.4 +1.4% 106
Nigeria Nigeria 36.9 -10.4% 30
Nicaragua Nicaragua 57.8 -0.365% 7
Netherlands Netherlands 19.3 -3.52% 85
Norway Norway 19.4 +0.581% 84
Nepal Nepal 19.7 -31.1% 82
New Zealand New Zealand 19.8 -12.1% 81
Pakistan Pakistan 44.2 -4.35% 18
Panama Panama 45.4 -6.5% 16
Peru Peru 33.1 +3.12% 37
Philippines Philippines 20.1 -19.6% 79
Poland Poland 21 +0.361% 76
Portugal Portugal 21.3 -9.11% 73
Paraguay Paraguay 45.8 +19.9% 15
Palestinian Territories Palestinian Territories 41.9 +24.2% 20
Qatar Qatar 37.2 +6.18% 29
Romania Romania 16.9 +2.16% 99
Russia Russia 18.5 -8.07% 88
Saudi Arabia Saudi Arabia 30.1 +0.886% 44
Singapore Singapore 34.6 +1.18% 34
Solomon Islands Solomon Islands 32.8 -2.41% 38
El Salvador El Salvador 31.6 -11.8% 40
Suriname Suriname 17 -10.2% 97
Slovakia Slovakia 30.2 -2.6% 43
Slovenia Slovenia 20.2 +4.36% 78
Sweden Sweden 12.5 -0.651% 108
Thailand Thailand 31.4 -5.92% 41
Tajikistan Tajikistan 70 -6.09% 2
Timor-Leste Timor-Leste 27.5 +29.1% 49
Tonga Tonga 31.2 -10.4% 42
Trinidad & Tobago Trinidad & Tobago 27.3 +8.86% 50
Turkey Turkey 40 +3.89% 22
Ukraine Ukraine 15.5 +21.9% 103
Uruguay Uruguay 26.9 +10.2% 53
United States United States 19.5 -1.2% 83
Uzbekistan Uzbekistan 44.3 -12.6% 17
St. Vincent & Grenadines St. Vincent & Grenadines 42.7 +2.25% 19
Samoa Samoa 39.8 -9.96% 24
South Africa South Africa 37.9 -7.24% 27

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