Arms imports (SIPRI trend indicator values)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 16,000,000 +6.67% 71
Albania Albania 12,000,000 +1,100% 74
United Arab Emirates United Arab Emirates 932,000,000 -1.69% 11
Argentina Argentina 43,000,000 +105% 60
Armenia Armenia 21,000,000 +200% 68
Australia Australia 983,000,000 +159% 8
Austria Austria 13,000,000 -23.5% 73
Azerbaijan Azerbaijan 28,000,000 +833% 64
Belgium Belgium 515,000,000 +4,192% 17
Benin Benin 6,000,000 -45.5% 79
Burkina Faso Burkina Faso 37,000,000 +94.7% 62
Bangladesh Bangladesh 75,000,000 +8.7% 46
Bahrain Bahrain 848,000,000 +188% 12
Belarus Belarus 151,000,000 -6.21% 37
Bolivia Bolivia 0 -100% 85
Brazil Brazil 435,000,000 +135% 20
Brunei Brunei 28,000,000 +155% 64
Botswana Botswana 11,000,000 +1,000% 75
Canada Canada 149,000,000 +96.1% 38
Chile Chile 14,000,000 +55.6% 72
China China 72,000,000 -83.3% 48
Côte d’Ivoire Côte d’Ivoire 3,000,000 -95.5% 82
Congo - Kinshasa Congo - Kinshasa 35,000,000 +29.6% 63
Colombia Colombia 19,000,000 +533% 69
Cyprus Cyprus 115,000,000 +945% 42
Czechia Czechia 50,000,000 -66.2% 57
Germany Germany 239,000,000 +19.5% 29
Denmark Denmark 427,000,000 +55.8% 22
Dominican Republic Dominican Republic 10,000,000 +11.1% 76
Algeria Algeria 128,000,000 -67.4% 40
Ecuador Ecuador 25,000,000 +257% 65
Egypt Egypt 72,000,000 -93.7% 48
Spain Spain 148,000,000 -16.9% 39
Estonia Estonia 63,000,000 +152% 52
Ethiopia Ethiopia 48,000,000 +2,300% 58
Finland Finland 64,000,000 +73% 51
Fiji Fiji 16,000,000 +129% 71
France France 188,000,000 +56.7% 34
Gabon Gabon 1,000,000 -93.8% 84
United Kingdom United Kingdom 643,000,000 +36.2% 13
Georgia Georgia 17,000,000 70
Ghana Ghana 11,000,000 +37.5% 75
Guinea Guinea 6,000,000 +500% 79
Equatorial Guinea Equatorial Guinea 12,000,000 74
Greece Greece 623,000,000 +54.2% 14
Guyana Guyana 9,000,000 +80% 77
Honduras Honduras 7,000,000 +75% 78
Croatia Croatia 90,000,000 +1.12% 43
Hungary Hungary 604,000,000 +147% 15
Indonesia Indonesia 186,000,000 -52.3% 35
India India 1,168,000,000 -21.7% 4
Iran Iran 42,000,000 +100% 61
Iraq Iraq 23,000,000 -20.7% 67
Israel Israel 211,000,000 -75.6% 32
Italy Italy 432,000,000 -10.9% 21
Jamaica Jamaica 10,000,000 0% 76
Jordan Jordan 24,000,000 +50% 66
Japan Japan 977,000,000 +2.09% 10
Kazakhstan Kazakhstan 550,000,000 +340% 16
Kenya Kenya 17,000,000 +1,600% 70
South Korea South Korea 1,009,000,000 +363% 7
Kuwait Kuwait 503,000,000 +1.21% 18
Laos Laos 7,000,000 +133% 78
Lebanon Lebanon 9,000,000 -35.7% 77
Libya Libya 5,000,000 -85.3% 80
Sri Lanka Sri Lanka 9,000,000 +80% 77
Lithuania Lithuania 51,000,000 -54.1% 56
Luxembourg Luxembourg 3,000,000 +200% 82
Latvia Latvia 10,000,000 -76.2% 76
Morocco Morocco 23,000,000 -95.1% 67
Maldives Maldives 7,000,000 +250% 78
Mexico Mexico 46,000,000 +1,050% 59
North Macedonia North Macedonia 1,000,000 -80% 84
Mali Mali 10,000,000 -87.8% 76
Myanmar (Burma) Myanmar (Burma) 222,000,000 +73.4% 31
Montenegro Montenegro 5,000,000 +150% 80
Mozambique Mozambique 1,000,000 -66.7% 84
Mauritania Mauritania 126,000,000 +6,200% 41
Namibia Namibia 54,000,000 +54.3% 55
Nigeria Nigeria 67,000,000 -28% 49
Netherlands Netherlands 360,000,000 -3.23% 24
Norway Norway 349,000,000 +74.5% 25
New Zealand New Zealand 200,000,000 -50.6% 33
Pakistan Pakistan 982,000,000 -59% 9
Peru Peru 4,000,000 -81.8% 81
Philippines Philippines 238,000,000 +90.4% 30
Poland Poland 1,448,000,000 +8.55% 2
Portugal Portugal 61,000,000 -8.96% 53
Qatar Qatar 1,152,000,000 -42.4% 5
Romania Romania 278,000,000 -19.2% 28
Russia Russia 467,000,000 +113% 19
Saudi Arabia Saudi Arabia 1,111,000,000 -14.3% 6
Sudan Sudan 2,000,000 -66.7% 83
Senegal Senegal 77,000,000 -55.2% 45
Singapore Singapore 348,000,000 -28% 26
El Salvador El Salvador 0 -100% 85
Somalia Somalia 4,000,000 0% 81
Serbia Serbia 153,000,000 -63.5% 36
Suriname Suriname 12,000,000 +300% 74
Slovakia Slovakia 298,000,000 +893% 27
Slovenia Slovenia 19,000,000 -26.9% 69
Sweden Sweden 66,000,000 -32.7% 50
Chad Chad 4,000,000 -87.5% 81
Thailand Thailand 73,000,000 -74.9% 47
Tunisia Tunisia 78,000,000 +136% 44
Turkey Turkey 381,000,000 -43.9% 23
Ukraine Ukraine 5,230,000,000 +21.9% 1
Uruguay Uruguay 10,000,000 +42.9% 76
United States United States 1,209,000,000 +52.7% 3
Vietnam Vietnam 58,000,000 +5.45% 54
Zambia Zambia 1,000,000 -80% 84

                    
# 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 = 'MS.MIL.MPRT.KD'

# 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 <- 'MS.MIL.MPRT.KD'

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