Tariff rate, applied, weighted mean, all products (%)

Source: worldbank.org, 03.09.2025

Year: 2022

Flag Country Value Value change, % Rank
Angola Angola 8.85 -21.9% 34
Albania Albania 0.26 -77% 109
Argentina Argentina 6.45 -0.922% 47
Australia Australia 0.99 +22.2% 104
Austria Austria 1.33 -4.32% 97
Azerbaijan Azerbaijan 5.45 -9.32% 52
Burundi Burundi 8.96 +5.04% 32
Belgium Belgium 1.33 -4.32% 97
Benin Benin 10.2 -6.7% 25
Burkina Faso Burkina Faso 7.25 -0.685% 45
Bangladesh Bangladesh 10.6 -3.56% 24
Bulgaria Bulgaria 1.33 -4.32% 97
Bahrain Bahrain 3.66 +75.1% 69
Bahamas Bahamas 16.3 -4.16% 9
Bosnia & Herzegovina Bosnia & Herzegovina 4.04 +44.3% 64
Belize Belize 18.1 +1.46% 5
Bermuda Bermuda 29.5 +23.8% 1
Bolivia Bolivia 5.08 -0.781% 56
Brazil Brazil 7.26 -6.44% 44
Barbados Barbados 14.6 +19.1% 10
Brunei Brunei 0.01 -50% 110
Bhutan Bhutan 4.79 +43.8% 58
Botswana Botswana 3.23 +240% 73
Central African Republic Central African Republic 14.5 -11.9% 11
Canada Canada 1.37 -41.7% 96
Switzerland Switzerland 1.3 -7.14% 98
Chile Chile 0.46 +6.98% 107
China China 2.18 -5.63% 82
Côte d’Ivoire Côte d’Ivoire 7.25 -4.98% 45
Cameroon Cameroon 18.1 +16.9% 4
Congo - Brazzaville Congo - Brazzaville 18.2 +57.4% 3
Colombia Colombia 2.83 +9.69% 77
Cape Verde Cape Verde 12.6 +26.1% 17
Costa Rica Costa Rica 1.3 -9.09% 98
Cuba Cuba 9.16 +2.81% 31
Cyprus Cyprus 1.33 -4.32% 97
Czechia Czechia 1.33 -4.32% 97
Germany Germany 1.33 -4.32% 97
Denmark Denmark 1.33 -4.32% 97
Dominican Republic Dominican Republic 3.97 +4.47% 66
Algeria Algeria 9.25 -10.1% 28
Ecuador Ecuador 5.19 +12.1% 55
Spain Spain 1.33 -4.32% 97
Estonia Estonia 1.33 -4.32% 97
Finland Finland 1.33 -4.32% 97
France France 1.33 -4.32% 97
Gabon Gabon 16.6 +14.3% 7
United Kingdom United Kingdom 1 +38.9% 103
Georgia Georgia 0.42 +23.5% 108
Ghana Ghana 12.5 +19% 18
Guinea Guinea 12.6 +2.77% 16
Gambia Gambia 16.4 -7.07% 8
Guinea-Bissau Guinea-Bissau 11.7 -1.02% 19
Equatorial Guinea Equatorial Guinea 18.2 +16.3% 3
Greece Greece 1.33 -4.32% 97
Grenada Grenada 13 +20.3% 14
Guatemala Guatemala 2.39 +39% 79
Guyana Guyana 9.27 +96% 27
Hong Kong SAR China Hong Kong SAR China 0 111
Honduras Honduras 2.11 -26% 85
Croatia Croatia 1.33 -4.32% 97
Hungary Hungary 1.33 -4.32% 97
Indonesia Indonesia 1.83 0% 88
India India 4.59 -21.8% 61
Ireland Ireland 1.33 -4.32% 97
Iceland Iceland 1.63 +7.95% 92
Israel Israel 2.62 -9.03% 78
Italy Italy 1.33 -4.32% 97
Jamaica Jamaica 9.24 +7.32% 29
Jordan Jordan 3.2 -19.6% 74
Japan Japan 1.64 -10.9% 91
Kazakhstan Kazakhstan 2.9 +33.6% 76
Kenya Kenya 11.7 +25.8% 19
Cambodia Cambodia 7.2 +34.1% 46
South Korea South Korea 5.66 +16.7% 51
Kuwait Kuwait 4.01 +40.7% 65
Laos Laos 1.41 +25.9% 95
Liberia Liberia 6.22 -6.33% 49
Lesotho Lesotho 3.36 +0.299% 72
Lithuania Lithuania 1.33 -4.32% 97
Latvia Latvia 1.33 -4.32% 97
Macao SAR China Macao SAR China 0 111
Moldova Moldova 1.16 -3.33% 101
Madagascar Madagascar 8.74 +16.4% 35
Maldives Maldives 11.1 +5.4% 22
Mexico Mexico 1.62 +33.9% 93
North Macedonia North Macedonia 2.34 -1.68% 80
Mali Mali 8.9 +12.9% 33
Malta Malta 1.33 -4.32% 97
Myanmar (Burma) Myanmar (Burma) 0.82 -21.2% 105
Montenegro Montenegro 2.9 -9.09% 76
Mongolia Mongolia 5.35 +1.33% 54
Mauritania Mauritania 8.68 +4.33% 36
Mauritius Mauritius 1.2 -5.51% 100
Malaysia Malaysia 3.42 -5.52% 71
Namibia Namibia 3.58 +171% 70
Niger Niger 8.36 -1.18% 39
Nigeria Nigeria 9.34 -23.4% 26
Nicaragua Nicaragua 2.04 +4.08% 86
Netherlands Netherlands 1.33 -4.32% 97
Norway Norway 2.31 -23% 81
Nepal Nepal 11.2 -6.59% 21
New Zealand New Zealand 1.7 +97.7% 90
Oman Oman 2.14 +7% 84
Pakistan Pakistan 7.61 -15.7% 42
Panama Panama 5.93 -7.78% 50
Peru Peru 0.66 +1.54% 106
Philippines Philippines 1.76 +1.73% 89
Poland Poland 1.33 -4.32% 97
Portugal Portugal 1.33 -4.32% 97
Paraguay Paraguay 4.63 +3.12% 60
Qatar Qatar 3.69 +4.53% 67
Romania Romania 1.33 -4.32% 97
Rwanda Rwanda 11.1 -7.18% 23
Saudi Arabia Saudi Arabia 5.4 +27.7% 53
Senegal Senegal 8.4 -5.41% 38
Singapore Singapore 0 111
Solomon Islands Solomon Islands 20.7 +44.4% 2
Sierra Leone Sierra Leone 13.7 -4.01% 12
El Salvador El Salvador 2.16 +14.9% 83
Suriname Suriname 7.8 -7.47% 41
Slovakia Slovakia 1.33 -4.32% 97
Slovenia Slovenia 1.33 -4.32% 97
Sweden Sweden 1.33 -4.32% 97
Eswatini Eswatini 2.98 +39.3% 75
Seychelles Seychelles 1.27 +18.7% 99
Chad Chad 16.8 +2.69% 6
Togo Togo 13.6 +26.4% 13
Thailand Thailand 3.67 +16.5% 68
Tonga Tonga 6.44 -2.28% 48
Trinidad & Tobago Trinidad & Tobago 7.51 -15.3% 43
Turkey Turkey 4.31 +33.9% 62
Tanzania Tanzania 8.64 -0.346% 37
Uganda Uganda 7.86 -9.34% 40
Ukraine Ukraine 1.86 +8.77% 87
Uruguay Uruguay 4.85 -7.62% 57
United States United States 1.49 +1.36% 94
St. Vincent & Grenadines St. Vincent & Grenadines 9.17 +1.21% 30
Venezuela Venezuela 12.8 -5.66% 15
Vietnam Vietnam 1.07 -8.55% 102
Vanuatu Vanuatu 11.5 +3.61% 20
South Africa South Africa 4.66 +4.48% 59
Zambia Zambia 4.08 -15.2% 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.TAX.MRCH.WM.AR.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 <- 'TM.TAX.MRCH.WM.AR.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))