Communications, computer, etc. (% of service imports, BoP)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 12.3 +13.4% 99
Albania Albania 10 -10.2% 105
Argentina Argentina 40.8 +2.38% 50
Armenia Armenia 10.9 +6.7% 104
Antigua & Barbuda Antigua & Barbuda 47.8 -6.25% 29
Australia Australia 38.6 +1.45% 55
Austria Austria 51 +0.145% 21
Azerbaijan Azerbaijan 37.1 +26.8% 62
Belgium Belgium 52.2 -3.46% 19
Bangladesh Bangladesh 16.3 +11.2% 95
Bulgaria Bulgaria 37.9 -5.66% 59
Bahrain Bahrain 20.9 -2.2% 88
Bahamas Bahamas 50.4 +11.3% 23
Bosnia & Herzegovina Bosnia & Herzegovina 11.8 +23.7% 101
Belize Belize 28.9 -6.74% 77
Brazil Brazil 54.3 +1.64% 16
Brunei Brunei 44.1 -18.3% 40
Bhutan Bhutan 8.36 -530% 107
Canada Canada 46.8 -3.85% 34
Switzerland Switzerland 69.1 -0.357% 4
Chile Chile 37.7 -1.13% 60
China China 27.3 -10.1% 80
Colombia Colombia 33 -8.42% 69
Cape Verde Cape Verde 38.9 -1.14% 54
Costa Rica Costa Rica 39.5 +4.18% 53
Cyprus Cyprus 54.2 +1.39% 17
Czechia Czechia 47.6 +0.633% 30
Germany Germany 49.8 +1.9% 26
Djibouti Djibouti 7.12 +8.88% 109
Dominica Dominica 40.1 -7.26% 51
Denmark Denmark 45 -5.43% 37
Dominican Republic Dominican Republic 25.7 +36.8% 83
Ecuador Ecuador 28 -12.6% 78
Spain Spain 47.8 -2.01% 28
Estonia Estonia 54.9 -1.23% 15
Finland Finland 64.5 -1.11% 5
France France 53.4 -1.77% 18
United Kingdom United Kingdom 50.2 -2.65% 24
Georgia Georgia 19.6 +14.7% 91
Gambia Gambia -1.45 -307% 110
Greece Greece 18 +7.12% 93
Grenada Grenada 58.3 -6.06% 11
Guatemala Guatemala 19.4 -9.39% 92
Hong Kong SAR China Hong Kong SAR China 12.3 -65.8% 98
Honduras Honduras 23.6 +0.452% 84
Croatia Croatia 47.1 -9.55% 32
Hungary Hungary 52 +0.0639% 20
Indonesia Indonesia 41.5 -0.402% 49
India India 60.5 +1.13% 9
Iceland Iceland 41.6 +0.712% 48
Israel Israel 62.7 +5.67% 8
Italy Italy 47.3 -0.639% 31
Jamaica Jamaica 38.1 +1.1% 57
Japan Japan 63.7 -5.61% 6
Kazakhstan Kazakhstan 33 -6.49% 70
Cambodia Cambodia 12.2 -21.5% 100
St. Kitts & Nevis St. Kitts & Nevis 34.9 -30.6% 66
South Korea South Korea 56.3 +1.46% 13
Kuwait Kuwait 13.6 +20.1% 97
St. Lucia St. Lucia 50.7 -6.8% 22
Lesotho Lesotho 11.2 -4.67% 103
Lithuania Lithuania 35.1 -3.19% 65
Luxembourg Luxembourg 34.5 -2.46% 67
Latvia Latvia 46.3 -2.01% 35
Moldova Moldova 23.3 -2.51% 86
Maldives Maldives 32.5 +1.79% 72
Mexico Mexico 32 -4.22% 74
North Macedonia North Macedonia 50 +75.3% 25
Malta Malta 74.8 -0.601% 2
Montenegro Montenegro 38.5 +9.01% 56
Mozambique Mozambique 46.8 +26% 33
Malaysia Malaysia 42.6 -1.1% 45
Namibia Namibia 79.7 -1.77% 1
Nigeria Nigeria 30.6 +18.4% 76
Nicaragua Nicaragua 11.5 -15.2% 102
Netherlands Netherlands 63 +0.0244% 7
Norway Norway 46.3 -0.775% 36
Nepal Nepal 8.25 +732% 108
New Zealand New Zealand 43.4 +6.61% 44
Pakistan Pakistan 26.8 +15.3% 81
Panama Panama 14 -0.266% 96
Peru Peru 33.8 -1.65% 68
Philippines Philippines 32.5 -15.3% 73
Poland Poland 56.3 +0.992% 12
Portugal Portugal 45 +3.49% 38
Paraguay Paraguay 23.5 +15.8% 85
Palestinian Territories Palestinian Territories 36.8 +21.8% 64
Qatar Qatar 26.1 -5.16% 82
Romania Romania 44.9 -2.92% 39
Russia Russia 20.7 -7.33% 89
Saudi Arabia Saudi Arabia 27.9 -34.4% 79
Singapore Singapore 49.4 -3.44% 27
Solomon Islands Solomon Islands 55.1 +8.43% 14
El Salvador El Salvador 16.6 -12.1% 94
Suriname Suriname 58.6 +7.73% 10
Slovakia Slovakia 42.4 -3.03% 46
Slovenia Slovenia 43.9 -2.39% 41
Sweden Sweden 71.3 +0.624% 3
Thailand Thailand 40 -0.593% 52
Tajikistan Tajikistan -2.18 -129% 111
Timor-Leste Timor-Leste 32.7 -12.8% 71
Tonga Tonga 31.5 -9.73% 75
Trinidad & Tobago Trinidad & Tobago 37.5 -3.05% 61
Turkey Turkey 36.8 -1.88% 63
Ukraine Ukraine 20.1 +12.1% 90
Uruguay Uruguay 43.7 +0.319% 42
United States United States 41.9 -0.889% 47
Uzbekistan Uzbekistan 9.08 +20.3% 106
St. Vincent & Grenadines St. Vincent & Grenadines 21.1 -25.5% 87
Samoa Samoa 37.9 -8.06% 58
South Africa South Africa 43.6 +3.15% 43

                    
# 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 = 'BM.GSR.CMCP.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 <- 'BM.GSR.CMCP.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))