Logistics performance index: Overall (1=low to 5=high)

Source: worldbank.org, 01.09.2025

Year: 2022

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 1.9 -2.56% 25
Angola Angola 2.1 +2.44% 23
Albania Albania 2.5 -6.02% 19
United Arab Emirates United Arab Emirates 4 +1.01% 4
Argentina Argentina 2.8 -3.11% 16
Armenia Armenia 2.5 -4.21% 19
Antigua & Barbuda Antigua & Barbuda 2.9 15
Australia Australia 3.7 -1.33% 7
Austria Austria 4 -0.744% 4
Belgium Belgium 4 -0.99% 4
Benin Benin 2.9 +5.45% 15
Burkina Faso Burkina Faso 2.3 -12.2% 21
Bangladesh Bangladesh 2.6 +0.775% 18
Bulgaria Bulgaria 3.2 +5.61% 12
Bahrain Bahrain 3.5 +19.5% 9
Bahamas Bahamas 2.7 +6.72% 17
Bosnia & Herzegovina Bosnia & Herzegovina 3 +6.76% 14
Belarus Belarus 2.7 +5.06% 17
Bolivia Bolivia 2.4 +1.69% 20
Brazil Brazil 3.2 +7.02% 12
Bhutan Bhutan 2.5 +15.2% 19
Botswana Botswana 3.1 +1.79% 13
Central African Republic Central African Republic 2.5 +16.3% 19
Canada Canada 4 +7.24% 4
Switzerland Switzerland 4.1 +5.13% 3
Chile Chile 3 -9.64% 14
China China 3.7 +2.49% 7
Cameroon Cameroon 2.1 -19.2% 23
Congo - Kinshasa Congo - Kinshasa 2.5 +2.88% 19
Congo - Brazzaville Congo - Brazzaville 2.6 +4.42% 18
Colombia Colombia 2.9 -1.36% 15
Costa Rica Costa Rica 2.9 +3.94% 15
Cuba Cuba 2.2 0% 22
Cyprus Cyprus 3.2 +1.59% 12
Czechia Czechia 3.3 -10.3% 11
Germany Germany 4.1 -2.38% 3
Djibouti Djibouti 2.7 +2.66% 17
Denmark Denmark 4.1 +2.76% 3
Dominican Republic Dominican Republic 2.6 -2.26% 18
Algeria Algeria 2.5 +2.04% 19
Egypt Egypt 3.1 +9.93% 13
Spain Spain 3.9 +1.83% 5
Estonia Estonia 3.6 +8.76% 8
Finland Finland 4.2 +5.79% 2
Fiji Fiji 2.3 -2.13% 21
France France 3.9 +1.56% 5
Gabon Gabon 2.4 +11.1% 20
United Kingdom United Kingdom 3.7 -7.27% 7
Georgia Georgia 2.7 +10.7% 17
Ghana Ghana 2.5 -2.72% 19
Guinea Guinea 2.5 +13.6% 19
Gambia Gambia 2.3 -4.17% 21
Guinea-Bissau Guinea-Bissau 2.6 +8.79% 18
Greece Greece 3.7 +15.6% 7
Grenada Grenada 2.5 19
Guatemala Guatemala 2.6 +7.88% 18
Guyana Guyana 2.4 +1.69% 20
Hong Kong SAR China Hong Kong SAR China 4 +2.04% 4
Honduras Honduras 2.9 +11.5% 15
Croatia Croatia 3.3 +6.45% 11
Haiti Haiti 2.1 -0.474% 23
Hungary Hungary 3.2 -6.43% 12
Indonesia Indonesia 3 -4.76% 14
India India 3.4 +6.92% 10
Ireland Ireland 3.6 +2.56% 8
Iran Iran 2.3 -19.3% 21
Iraq Iraq 2.4 +10.1% 20
Iceland Iceland 3.6 +11.5% 8
Israel Israel 3.6 +8.76% 8
Italy Italy 3.7 -1.07% 7
Jamaica Jamaica 2.5 -0.794% 19
Japan Japan 3.9 -3.23% 5
Kazakhstan Kazakhstan 2.7 -3.91% 17
Kyrgyzstan Kyrgyzstan 2.3 -9.8% 21
Cambodia Cambodia 2.4 -6.98% 20
South Korea South Korea 3.8 +5.26% 6
Kuwait Kuwait 3.2 +11.9% 12
Laos Laos 2.4 -11.1% 20
Liberia Liberia 2.4 +7.62% 20
Libya Libya 1.9 -9.95% 25
Sri Lanka Sri Lanka 2.8 +7.69% 16
Lithuania Lithuania 3.4 +12.6% 10
Luxembourg Luxembourg 3.6 -0.826% 8
Latvia Latvia 3.5 +24.6% 9
Moldova Moldova 2.5 +1.63% 19
Madagascar Madagascar 2.3 -3.77% 21
Mexico Mexico 2.9 -4.92% 15
North Macedonia North Macedonia 3.1 +14.8% 13
Mali Mali 2.6 +0.386% 18
Malta Malta 3.3 +17.4% 11
Montenegro Montenegro 2.8 +1.82% 16
Mongolia Mongolia 2.5 +5.49% 19
Mauritania Mauritania 2.3 -1.29% 21
Mauritius Mauritius 2.5 -8.42% 19
Malaysia Malaysia 3.6 +11.8% 8
Namibia Namibia 2.9 +5.66% 15
Nigeria Nigeria 2.6 +2.77% 18
Nicaragua Nicaragua 2.5 -1.23% 19
Netherlands Netherlands 4.1 +1.99% 3
Norway Norway 3.7 0% 7
New Zealand New Zealand 3.6 -7.22% 8
Oman Oman 3.3 +3.12% 11
Panama Panama 3.1 -5.49% 13
Peru Peru 3 +11.5% 14
Philippines Philippines 3.3 +13.8% 11
Papua New Guinea Papua New Guinea 2.7 +24.4% 17
Poland Poland 3.6 +1.69% 8
Portugal Portugal 3.4 -6.59% 10
Paraguay Paraguay 2.7 -2.88% 17
Qatar Qatar 3.5 +0.865% 9
Romania Romania 3.2 +2.56% 12
Russia Russia 2.6 -5.8% 18
Rwanda Rwanda 2.8 -5.72% 16
Saudi Arabia Saudi Arabia 3.4 +13% 10
Sudan Sudan 2.4 -1.23% 20
Singapore Singapore 4.3 +7.5% 1
Solomon Islands Solomon Islands 2.8 +8.95% 16
El Salvador El Salvador 2.7 +4.65% 17
Somalia Somalia 2 -9.5% 24
Serbia Serbia 2.8 -1.41% 16
Slovakia Slovakia 3.3 +8.91% 11
Slovenia Slovenia 3.3 -0.302% 11
Sweden Sweden 4 -1.23% 4
Syria Syria 2.3 0% 21
Togo Togo 2.5 +2.04% 19
Thailand Thailand 3.5 +2.64% 9
Tajikistan Tajikistan 2.5 +6.84% 19
Trinidad & Tobago Trinidad & Tobago 2.5 +3.31% 19
Turkey Turkey 3.4 +7.94% 10
Ukraine Ukraine 2.7 -4.59% 17
Uruguay Uruguay 3 +11.5% 14
United States United States 3.8 -2.31% 6
Uzbekistan Uzbekistan 2.6 +0.775% 18
Venezuela Venezuela 2.3 +3.14% 21
Vietnam Vietnam 3.3 +0.917% 11
Yemen Yemen 2.2 -3.08% 22
South Africa South Africa 3.7 +9.47% 7
Zimbabwe Zimbabwe 2.5 +17.9% 19

                    
# 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 = 'LP.LPI.OVRL.XQ'

# 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 <- 'LP.LPI.OVRL.XQ'

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