Time required to obtain an operating license (days)

Source: worldbank.org, 03.09.2025

Year: 2024

Flag Country Value Value change, % Rank
Angola Angola 29.1 -16.2% 13
Armenia Armenia 19.4 +169% 27
Azerbaijan Azerbaijan 12 -13.9% 37
Belgium Belgium 146 +52.9% 3
Benin Benin 77.8 +235% 5
Burkina Faso Burkina Faso 24.7 -31.1% 16
Bahrain Bahrain 20.8 24
Bhutan Bhutan 5.27 +324% 46
Canada Canada 9.66 40
China China 6.48 -76.4% 43
Cameroon Cameroon 13 -63.4% 36
Congo - Kinshasa Congo - Kinshasa 18.5 -23.2% 28
Congo - Brazzaville Congo - Brazzaville 5.47 -21.8% 45
Cape Verde Cape Verde 15.6 -60.2% 32
Cyprus Cyprus 28.4 -19.6% 14
Czechia Czechia 73.9 +123% 6
Ecuador Ecuador 26.3 -9.88% 15
Spain Spain 65.8 -16.1% 7
United Kingdom United Kingdom 37.2 10
Equatorial Guinea Equatorial Guinea 16.8 31
Ireland Ireland 23.7 +54.3% 19
Iceland Iceland 43.2 9
Israel Israel 34.5 -82.1% 11
Italy Italy 20.8 -36.3% 25
Jamaica Jamaica 13.4 +44.2% 34
Jordan Jordan 2.79 +1.29% 50
Kazakhstan Kazakhstan 17.1 -34.4% 30
South Korea South Korea 193 1
Laos Laos 20 -26% 26
Latvia Latvia 24.5 +35.2% 17
Moldova Moldova 10.7 -3.91% 38
Mali Mali 4.05 -90.8% 48
Malta Malta 31.5 -68.1% 12
Malaysia Malaysia 13.3 -2.03% 35
Namibia Namibia 21.4 -12.1% 22
Papua New Guinea Papua New Guinea 21.3 +2.16% 23
Senegal Senegal 5.13 -81.5% 47
Serbia Serbia 9.66 -89.6% 39
South Sudan South Sudan 5.51 -40.1% 44
Slovenia Slovenia 23.3 -70.3% 20
Sweden Sweden 45.8 +33.1% 8
Eswatini Eswatini 3.13 -40.6% 49
Tajikistan Tajikistan 13.9 -12.4% 33
Turkmenistan Turkmenistan 24.1 18
Tonga Tonga 7.43 +129% 41
Tunisia Tunisia 111 +51.6% 4
Turkey Turkey 22 +23% 21
Uruguay Uruguay 167 -5.09% 2
United States United States 17.7 29
Uzbekistan Uzbekistan 6.51 -58.5% 42

                    
# 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 = 'IC.FRM.DURS'

# 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 <- 'IC.FRM.DURS'

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