Employment to population ratio, ages 15-24, female (%)

Source: worldbank.org, 19.12.2024

Year: 2023

Flag Country Value Value change, % Rank
United Arab Emirates United Arab Emirates 22.9 +3.67% 64
Argentina Argentina 27.7 +6.61% 51
Australia Australia 65.6 -1.97% 4
Austria Austria 49.8 +3.36% 12
Belgium Belgium 25.9 +2.08% 54
Burkina Faso Burkina Faso 23.7 -52% 61
Bulgaria Bulgaria 16.2 +0.161% 76
Bahamas Bahamas 81.2 +82.8% 1
Bosnia & Herzegovina Bosnia & Herzegovina 12.8 -5.96% 80
Belarus Belarus 33.7 -7.71% 32
Bolivia Bolivia 53.4 +0.321% 10
Brazil Brazil 38.2 +1.2% 26
Brunei Brunei 21.3 -11.5% 67
Bhutan Bhutan 25.7 +35.6% 56
Botswana Botswana 18.7 +8.47% 70
Canada Canada 58.6 -2.58% 8
Switzerland Switzerland 59.9 -0.422% 6
Chile Chile 20.2 -3.04% 68
Colombia Colombia 28.9 +5.34% 46
Costa Rica Costa Rica 23.1 +0.966% 62
Cyprus Cyprus 36.4 +8.8% 28
Czechia Czechia 21.8 +2.03% 66
Germany Germany 48.7 +0.684% 15
Denmark Denmark 58.2 +3.36% 9
Dominican Republic Dominican Republic 32.6 +11.2% 34
Ecuador Ecuador 30.1 -3.82% 43
Spain Spain 22.1 +3.1% 65
Estonia Estonia 38.7 -4.16% 24
Finland Finland 47.9 +2.02% 17
France France 31.7 +0.527% 37
United Kingdom United Kingdom 47.4 -4.95% 19
Gambia Gambia 25.5 -35.6% 57
Greece Greece 16.3 +24.3% 74
Guatemala Guatemala 41.3 +34.4% 23
Hong Kong SAR China Hong Kong SAR China 28.5 -2.26% 48
Honduras Honduras 28.7 -9.43% 47
Croatia Croatia 19.5 -15% 69
Hungary Hungary 23.9 -3.8% 60
Indonesia Indonesia 33.1 +1.23% 33
India India 14.7 +39.8% 77
Ireland Ireland 48.5 +0.625% 16
Iceland Iceland 75.8 +1.43% 3
Israel Israel 45 +1.82% 20
Italy Italy 16.2 +1.3% 75
Jamaica Jamaica 30.6 +8.16% 41
Japan Japan 49.4 +3.1% 13
South Korea South Korea 29.7 -3.05% 44
Lithuania Lithuania 31.9 -1.44% 36
Luxembourg Luxembourg 25.8 -9.67% 55
Latvia Latvia 29.5 -0.905% 45
Moldova Moldova 34.2 -3.49% 30
Mexico Mexico 31.5 +4.8% 39
North Macedonia North Macedonia 13 +2.55% 79
Malta Malta 49 -7.12% 14
Mongolia Mongolia 17.4 -27.4% 73
Mauritius Mauritius 30.6 +36.7% 42
Netherlands Netherlands 76.2 +1.14% 2
Norway Norway 59.3 -0.123% 7
New Zealand New Zealand 60.8 -0.509% 5
Panama Panama 26.1 +2.21% 53
Peru Peru 47.5 -6.54% 18
Poland Poland 25.1 +7.04% 59
Portugal Portugal 26.8 +16.5% 52
Paraguay Paraguay 38.4 +2.71% 25
Romania Romania 13.7 -4.54% 78
Russia Russia 23 +4.12% 63
Rwanda Rwanda 33.8 +18.3% 31
Saudi Arabia Saudi Arabia 12.8 +3.66% 81
Singapore Singapore 31.6 +1.05% 38
El Salvador El Salvador 31.1 +3.67% 40
Serbia Serbia 18.2 -2.17% 71
Slovakia Slovakia 17.8 +12.7% 72
Slovenia Slovenia 28.4 -2.37% 49
Sweden Sweden 44.8 +3.45% 21
Seychelles Seychelles 42.1 -8.12% 22
Thailand Thailand 32.4 +5.74% 35
Tunisia Tunisia 9.45 -11.9% 82
Turkey Turkey 25.3 +9.38% 58
Uruguay Uruguay 27.8 -5.83% 50
United States United States 52 +2.74% 11
Vietnam Vietnam 37.6 -4.49% 27
South Africa South Africa 9.02 +13.3% 83
Zimbabwe Zimbabwe 36.1 +8.26% 29

                    
# 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 = 'SL.EMP.1524.SP.FE.NE.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 <- 'SL.EMP.1524.SP.FE.NE.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))