Manufactures imports (% of merchandise imports)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Albania Albania 63.2 -2.31% 51
Argentina Argentina 79.6 +7.74% 7
Armenia Armenia 43.4 -33.7% 85
Antigua & Barbuda Antigua & Barbuda 68.5 -0.113% 28
Australia Australia 75.3 +1.42% 16
Azerbaijan Azerbaijan 59.5 -12% 68
Belgium Belgium 66.2 -2.64% 35
Burkina Faso Burkina Faso 46.9 -2.57% 82
Bulgaria Bulgaria 60 -4.49% 65
Bosnia & Herzegovina Bosnia & Herzegovina 64.3 +0.768% 48
Belize Belize 64.8 +1.25% 45
Bolivia Bolivia 61.5 -5.16% 58
Brazil Brazil 77.4 +2.61% 10
Barbados Barbados 52.6 +3.29% 78
Canada Canada 75.3 -0.83% 17
Switzerland Switzerland 60 -0.587% 66
Chile Chile 66 +2.15% 36
China China 49.3 +1.35% 81
Cyprus Cyprus 59.4 -3.06% 69
Czechia Czechia 83.7 +0.317% 1
Germany Germany 72.1 -0.756% 23
Denmark Denmark 74.5 +7.9% 19
Dominican Republic Dominican Republic 63.1 +2.92% 52
Ecuador Ecuador 59.2 -0.891% 70
Egypt Egypt 52.2 -3% 80
Spain Spain 65.3 +1.36% 39
Estonia Estonia 67 +4.56% 30
Finland Finland 63.4 -1.1% 50
Fiji Fiji 56.5 +1.96% 73
United Kingdom United Kingdom 61.5 -4.05% 57
Georgia Georgia 72.6 +0.633% 21
Greece Greece 54.6 +4.48% 75
Grenada Grenada 56.2 +1.31% 74
Guatemala Guatemala 64.4 +1.49% 47
Guyana Guyana 76.1 +10.4% 15
Hong Kong SAR China Hong Kong SAR China 83 +0.121% 3
Croatia Croatia 65.8 +0.229% 37
Hungary Hungary 79.6 +0.292% 6
India India 46.5 -3.02% 83
Ireland Ireland 82.7 +0.415% 4
Iceland Iceland 66.8 +0.663% 32
Israel Israel 74.5 +0.442% 18
Italy Italy 66.7 +1.41% 33
Japan Japan 57.1 +5.74% 72
Kyrgyzstan Kyrgyzstan 77.4 -5.33% 9
South Korea South Korea 60.1 +1.47% 64
Sri Lanka Sri Lanka 59.7 +5.63% 67
Lithuania Lithuania 62 +1.66% 53
Luxembourg Luxembourg 65.2 -0.414% 42
Latvia Latvia 60.8 -1.16% 59
Macao SAR China Macao SAR China 71.7 -5.4% 24
Moldova Moldova 64.9 +6.42% 44
Maldives Maldives 53.7 +0.791% 77
Mexico Mexico 77 +2.68% 12
North Macedonia North Macedonia 64.5 +2.58% 46
Malta Malta 65.2 -5.67% 41
Myanmar (Burma) Myanmar (Burma) 52.6 -2.3% 79
Montenegro Montenegro 63.7 +1.54% 49
Mauritius Mauritius 54.2 +0.541% 76
Malaysia Malaysia 66.9 +3.95% 31
Namibia Namibia 60.4 +4.74% 62
Netherlands Netherlands 64.9 +4.88% 43
Norway Norway 73.8 +2.48% 20
New Zealand New Zealand 70.1 -0.992% 26
Pakistan Pakistan 46.1 +10.6% 84
Panama Panama 60.2 -3.82% 63
Philippines Philippines 65.2 -0.145% 40
Poland Poland 76.6 +1.58% 13
Portugal Portugal 69.7 +1.42% 27
Paraguay Paraguay 76.5 -0.892% 14
French Polynesia French Polynesia 39.4 -0.152% 86
Romania Romania 77.2 +1.61% 11
El Salvador El Salvador 62 +2.43% 54
Suriname Suriname 70.7 -0.772% 25
Slovakia Slovakia 80.8 -0.327% 5
Slovenia Slovenia 83.1 +4.96% 2
Sweden Sweden 68.5 -0.673% 29
Togo Togo 61.7 -3.71% 56
Thailand Thailand 65.8 -0.919% 38
Trinidad & Tobago Trinidad & Tobago 61.9 +38.4% 55
Turkey Turkey 60.8 +5.42% 60
Ukraine Ukraine 66.4 +5.11% 34
United States United States 78.4 +1.48% 8
Uzbekistan Uzbekistan 72.6 -5.82% 22
South Africa South Africa 60.7 +0.1% 61
Zimbabwe Zimbabwe 58.3 -9.8% 71

                    
# 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.MANF.ZS.UN'

# 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.MANF.ZS.UN'

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