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

Source: worldbank.org, 03.09.2025

Year: 2022

Flag Country Value Value change, % Rank
Angola Angola 9.84 -51.4% 34
Albania Albania 0.74 -67.5% 108
Argentina Argentina 1.08 -16.9% 103
Australia Australia 0.8 +11.1% 107
Austria Austria 0.84 -37.3% 106
Azerbaijan Azerbaijan 3.89 -18.1% 67
Burundi Burundi 16 -1.23% 18
Belgium Belgium 0.84 -37.3% 106
Benin Benin 12.3 -7.61% 26
Burkina Faso Burkina Faso 5.64 +8.46% 58
Bangladesh Bangladesh 5.31 -7.65% 60
Bulgaria Bulgaria 0.84 -37.3% 106
Bahrain Bahrain 4.79 +226% 63
Bahamas Bahamas 5.85 -0.51% 56
Bosnia & Herzegovina Bosnia & Herzegovina 7.41 +71.1% 50
Belize Belize 38.6 +4.55% 3
Bermuda Bermuda 45.1 +47.5% 2
Bolivia Bolivia 3.27 +10.8% 76
Brazil Brazil 1.93 -16.5% 94
Barbados Barbados 20.2 +0.0496% 8
Brunei Brunei 0 112
Bhutan Bhutan 6.2 +66.2% 53
Botswana Botswana 7.68 +227% 48
Central African Republic Central African Republic 20.1 +16.4% 9
Canada Canada 4.06 -21.2% 65
Switzerland Switzerland 9.44 -22.6% 37
Chile Chile 0.38 +11.8% 110
China China 2 -1.96% 91
Côte d’Ivoire Côte d’Ivoire 5.64 -4.89% 58
Cameroon Cameroon 19.9 +8.38% 10
Congo - Brazzaville Congo - Brazzaville 18.8 +10.5% 13
Colombia Colombia 2.26 -1.31% 86
Cape Verde Cape Verde 14.7 -0.406% 22
Costa Rica Costa Rica 3.34 -9.97% 74
Cuba Cuba 8 +24.8% 42
Cyprus Cyprus 0.84 -37.3% 106
Czechia Czechia 0.84 -37.3% 106
Germany Germany 0.84 -37.3% 106
Denmark Denmark 0.84 -37.3% 106
Dominican Republic Dominican Republic 3.56 +41.8% 71
Algeria Algeria 7.95 -19.6% 44
Ecuador Ecuador 1.99 +57.9% 92
Spain Spain 0.84 -37.3% 106
Estonia Estonia 0.84 -37.3% 106
Finland Finland 0.84 -37.3% 106
France France 0.84 -37.3% 106
Gabon Gabon 19.3 +26.3% 11
United Kingdom United Kingdom 1.81 +77.5% 95
Georgia Georgia 0.86 +59.3% 105
Ghana Ghana 15.9 +27% 19
Guinea Guinea 15.2 -1.68% 20
Gambia Gambia 18.1 +4.62% 14
Guinea-Bissau Guinea-Bissau 15 +13.3% 21
Equatorial Guinea Equatorial Guinea 22.7 +6.13% 6
Greece Greece 0.84 -37.3% 106
Grenada Grenada 14 -9.27% 24
Guatemala Guatemala 3.51 +126% 72
Guyana Guyana 13.4 +28.4% 25
Hong Kong SAR China Hong Kong SAR China 0 112
Honduras Honduras 3.32 -1.19% 75
Croatia Croatia 0.84 -37.3% 106
Hungary Hungary 0.84 -37.3% 106
Indonesia Indonesia 2.13 -7.39% 89
India India 2.49 -29.3% 82
Ireland Ireland 0.84 -37.3% 106
Iceland Iceland 6.03 +4.69% 54
Israel Israel 5.13 -17.5% 61
Italy Italy 0.84 -37.3% 106
Jamaica Jamaica 9.2 +19.6% 38
Jordan Jordan 3.71 -24.1% 70
Japan Japan 2.53 -16.8% 81
Kazakhstan Kazakhstan 2.15 +40.5% 88
Kenya Kenya 17.7 +28.3% 16
Cambodia Cambodia 6.44 +165% 52
South Korea South Korea 10.9 -14% 30
Kuwait Kuwait 3.89 +103% 67
Laos Laos 1.67 +104% 97
Liberia Liberia 19.1 +7.53% 12
Lesotho Lesotho 2.19 +85.6% 87
Lithuania Lithuania 0.84 -37.3% 106
Latvia Latvia 0.84 -37.3% 106
Macao SAR China Macao SAR China 0 112
Moldova Moldova 1.19 -25.6% 101
Madagascar Madagascar 6.63 +7.28% 51
Maldives Maldives 7.98 +1.14% 43
Mexico Mexico 0.65 +16.1% 109
North Macedonia North Macedonia 3.84 -12.3% 69
Mali Mali 9.72 +2.53% 35
Malta Malta 0.84 -37.3% 106
Myanmar (Burma) Myanmar (Burma) 1.41 +11% 98
Montenegro Montenegro 5.52 -20.1% 59
Mongolia Mongolia 7.7 +4.76% 47
Mauritania Mauritania 7.57 +22.9% 49
Mauritius Mauritius 1.95 -7.14% 93
Malaysia Malaysia 3.03 -3.81% 78
Namibia Namibia 3.05 +235% 77
Niger Niger 8.85 -8.2% 39
Nigeria Nigeria 9.62 -16.4% 36
Nicaragua Nicaragua 1.2 -22.6% 100
Netherlands Netherlands 0.84 -37.3% 106
Norway Norway 8.33 -31.7% 41
Nepal Nepal 10.8 -4.92% 31
New Zealand New Zealand 1.24 +96.8% 99
Oman Oman 2.3 +11.1% 85
Pakistan Pakistan 4.95 -10.8% 62
Panama Panama 11.2 -10.3% 27
Peru Peru 0.11 +37.5% 111
Philippines Philippines 3.88 -14.2% 68
Poland Poland 0.84 -37.3% 106
Portugal Portugal 0.84 -37.3% 106
Paraguay Paraguay 2.62 +9.62% 80
Qatar Qatar 3.36 +15.5% 73
Romania Romania 0.84 -37.3% 106
Rwanda Rwanda 24.1 +2.21% 4
Saudi Arabia Saudi Arabia 5.76 +28.6% 57
Senegal Senegal 7.75 -2.88% 46
Singapore Singapore 0 112
Solomon Islands Solomon Islands 48.8 +102% 1
Sierra Leone Sierra Leone 17.7 +0.91% 15
El Salvador El Salvador 1.77 +29.2% 96
Suriname Suriname 10.4 -5.44% 33
Slovakia Slovakia 0.84 -37.3% 106
Slovenia Slovenia 0.84 -37.3% 106
Sweden Sweden 0.84 -37.3% 106
Eswatini Eswatini 2.31 +305% 84
Seychelles Seychelles 5.97 +39.2% 55
Chad Chad 23.8 +35.7% 5
Togo Togo 11.2 -4.04% 28
Thailand Thailand 4.59 -23.9% 64
Tonga Tonga 4.03 0% 66
Trinidad & Tobago Trinidad & Tobago 10.8 -30.7% 32
Turkey Turkey 7.85 +10.7% 45
Tanzania Tanzania 22.4 +7.97% 7
Uganda Uganda 14.2 +6.23% 23
Ukraine Ukraine 1.24 +5.08% 99
Uruguay Uruguay 1.18 -38.2% 102
United States United States 1 -2.91% 104
St. Vincent & Grenadines St. Vincent & Grenadines 8.8 +1.03% 40
Venezuela Venezuela 11.1 +4.03% 29
Vietnam Vietnam 2.03 -19.4% 90
Vanuatu Vanuatu 17.5 +17% 17
South Africa South Africa 2.4 -14% 83
Zambia Zambia 2.76 +21.6% 79

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