Trademark applications, resident, by count

Source: worldbank.org, 03.09.2025

Year: 2021

Flag Country Value Value change, % Rank
Albania Albania 1,823 +41.6% 87
Andorra Andorra 919 +27.6% 98
United Arab Emirates United Arab Emirates 8,281 +29.1% 55
Argentina Argentina 70,131 +8.88% 19
Armenia Armenia 4,233 +22% 69
Antigua & Barbuda Antigua & Barbuda 371 +24.1% 104
Australia Australia 97,211 +8.03% 15
Austria Austria 17,472 +4.79% 41
Azerbaijan Azerbaijan 5,657 +42.6% 60
Bangladesh Bangladesh 10,831 +10.7% 50
Bulgaria Bulgaria 10,906 +1.07% 49
Bahrain Bahrain 405 +11.6% 102
Bosnia & Herzegovina Bosnia & Herzegovina 1,013 +17.2% 97
Belarus Belarus 4,610 -7.39% 68
Bolivia Bolivia 4,838 +25.1% 64
Brazil Brazil 346,752 +33% 6
Barbados Barbados 194 +32% 107
Brunei Brunei 177 -24.4% 108
Bhutan Bhutan 155 -39.2% 110
Canada Canada 66,458 +6.23% 20
Switzerland Switzerland 46,420 +3.03% 22
Chile Chile 53,520 +14.6% 21
China China 9,192,753 +0.836% 1
Colombia Colombia 33,617 +7.16% 28
Cape Verde Cape Verde 65 -16.7% 112
Costa Rica Costa Rica 8,878 +4.1% 54
Cuba Cuba 1,840 -35.6% 86
Curaçao Curaçao 157 109
Cyprus Cyprus 1,603 +21.4% 88
Czechia Czechia 22,855 +6.51% 36
Germany Germany 246,296 +3.34% 11
Djibouti Djibouti 36 +16.1% 114
Dominica Dominica 8 +60% 120
Denmark Denmark 5,520 +4.64% 61
Dominican Republic Dominican Republic 9,806 +21.5% 53
Algeria Algeria 11,147 -9.74% 48
Ecuador Ecuador 13,951 +12.8% 45
Egypt Egypt 43,212 +48.3% 25
Spain Spain 72,620 +0.996% 18
Estonia Estonia 3,392 +18.4% 73
Ethiopia Ethiopia 1,428 -11.6% 92
Finland Finland 5,746 -7.87% 59
France France 298,103 +8.77% 9
United Kingdom United Kingdom 223,508 +20.3% 12
Georgia Georgia 2,876 +10.7% 78
Gambia Gambia 121 -22.4% 111
Grenada Grenada 13 -51.9% 117
Hong Kong SAR China Hong Kong SAR China 31,154 +5.05% 31
Honduras Honduras 2,293 +33.2% 83
Croatia Croatia 3,351 -30.3% 75
Hungary Hungary 7,979 +8% 56
Indonesia Indonesia 91,362 +13.4% 16
India India 435,581 +13.9% 4
Iran Iran 506,935 -3.7% 3
Iraq Iraq 1,068 +226% 96
Iceland Iceland 1,419 +4.65% 93
Israel Israel 5,080 +8.15% 62
Italy Italy 108,275 +20.1% 14
Jamaica Jamaica 2,576 -15.3% 79
Jordan Jordan 3,242 +17.8% 76
Japan Japan 269,517 -21.4% 10
Kazakhstan Kazakhstan 13,043 +24.8% 46
Kyrgyzstan Kyrgyzstan 495 +7.14% 101
South Korea South Korea 299,622 +11.3% 8
Liechtenstein Liechtenstein 396 +8.49% 103
Sri Lanka Sri Lanka 6,321 -5.32% 57
Lithuania Lithuania 3,377 -0.618% 74
Latvia Latvia 2,321 +27.5% 82
Macao SAR China Macao SAR China 2,504 +7.98% 81
Morocco Morocco 20,432 +10.6% 38
Monaco Monaco 1,525 +9.01% 90
Moldova Moldova 3,973 +1.61% 70
Madagascar Madagascar 2,966 +8.92% 77
Mexico Mexico 142,012 +20% 13
North Macedonia North Macedonia 2,137 +53.9% 85
Malta Malta 1,245 +13.2% 94
Mongolia Mongolia 19,104 +42.5% 40
Mozambique Mozambique 1,499 -12.2% 91
Mauritius Mauritius 2,540 +3% 80
Malaysia Malaysia 20,128 +9.3% 39
Norway Norway 11,792 +6.63% 47
New Zealand New Zealand 24,096 +6.5% 35
Oman Oman 6,250 +16.4% 58
Pakistan Pakistan 43,233 +18.6% 24
Panama Panama 4,782 -11.6% 66
Peru Peru 29,557 +12.5% 32
Philippines Philippines 34,976 +13.1% 27
Papua New Guinea Papua New Guinea 300 +40.2% 106
Poland Poland 35,855 +13.6% 26
Portugal Portugal 32,344 +7.64% 30
Paraguay Paraguay 16,680 +12.5% 42
Qatar Qatar 1,545 +20.5% 89
Romania Romania 20,988 -0.733% 37
Russia Russia 327,409 -4.1% 7
Rwanda Rwanda 682 +72.2% 99
Saudi Arabia Saudi Arabia 24,411 +20.3% 34
Singapore Singapore 15,088 +17.8% 44
El Salvador El Salvador 4,883 +55.5% 63
Somalia Somalia 12 +100% 118
Serbia Serbia 3,833 -6.69% 71
São Tomé & Príncipe São Tomé & Príncipe 4 -82.6% 121
Suriname Suriname 340 +7.94% 105
Slovakia Slovakia 10,112 +15.2% 52
Slovenia Slovenia 3,568 -6.99% 72
Sweden Sweden 15,190 -3.6% 43
Seychelles Seychelles 33 -60.7% 115
Thailand Thailand 33,401 +0.712% 29
Tonga Tonga 3 -57.1% 122
Trinidad & Tobago Trinidad & Tobago 662 -26.1% 100
Turkey Turkey 395,159 +19.2% 5
Uganda Uganda 2,158 +38% 84
Ukraine Ukraine 44,202 +14.8% 23
Uruguay Uruguay 4,835 +18% 65
United States United States 551,764 +0.427% 2
Uzbekistan Uzbekistan 10,476 +27.9% 51
St. Vincent & Grenadines St. Vincent & Grenadines 17 -50% 116
Vietnam Vietnam 77,404 +0.739% 17
Vanuatu Vanuatu 11 -8.33% 119
Samoa Samoa 47 -44.7% 113
Yemen Yemen 4,662 +2.15% 67
South Africa South Africa 25,786 +16.7% 33
Zambia Zambia 1,171 -38.5% 95

                    
# 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 = 'IP.TMK.RSCT'

# 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 <- 'IP.TMK.RSCT'

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