Employment to population ratio, 15+, female (%)

Source: worldbank.org, 19.12.2024

Year: 2023

Flag Country Value Value change, % Rank
United Arab Emirates United Arab Emirates 52.2 +1.45% 41
Argentina Argentina 49.6 +3.06% 54
Australia Australia 60.6 +0.538% 10
Austria Austria 54 +0.206% 36
Belgium Belgium 48.1 -0.0166% 57
Burkina Faso Burkina Faso 39.4 -38% 72
Bulgaria Bulgaria 47.7 -1.76% 59
Bahamas Bahamas 90.6 +35.1% 1
Bosnia & Herzegovina Bosnia & Herzegovina 36.8 +5.77% 78
Belarus Belarus 63.4 -0.69% 7
Bolivia Bolivia 70.1 +1.81% 3
Brazil Brazil 48 +0.814% 58
Brunei Brunei 51.5 +3.5% 45
Bhutan Bhutan 54.4 +10.6% 34
Botswana Botswana 46.1 +3.64% 63
Canada Canada 58.4 +0.123% 18
Switzerland Switzerland 59.9 +1.14% 14
Chile Chile 47.2 +3.24% 60
Colombia Colombia 45.9 +3.38% 66
Costa Rica Costa Rica 39.4 -7.27% 73
Cyprus Cyprus 57.2 +3.89% 22
Czechia Czechia 50.2 -1.08% 52
Germany Germany 54.8 +0.466% 30
Denmark Denmark 56.6 -0.354% 23
Dominican Republic Dominican Republic 48.4 +3.97% 56
Ecuador Ecuador 50.6 -1.06% 49
Spain Spain 46 +1.29% 65
Estonia Estonia 57.9 +0.601% 20
Finland Finland 54.8 +0.529% 32
France France 49 +0.496% 55
United Kingdom United Kingdom 56 -0.155% 25
Gambia Gambia 42.7 -21.4% 70
Greece Greece 38.4 +2.93% 74
Guatemala Guatemala 50.8 +28.1% 47
Hong Kong SAR China Hong Kong SAR China 51 -0.135% 46
Honduras Honduras 36.8 -5.4% 77
Croatia Croatia 44.2 +2.46% 68
Hungary Hungary 52.2 +0.774% 40
Indonesia Indonesia 51.7 +1.77% 43
India India 33.7 +24.8% 79
Ireland Ireland 57.9 +2.19% 21
Iceland Iceland 68.3 -0.0468% 4
Israel Israel 59.4 +0.779% 16
Italy Italy 37.9 +2.66% 75
Jamaica Jamaica 58.2 +5.09% 19
Japan Japan 53.6 +1.16% 37
South Korea South Korea 54.5 +2.2% 33
Lithuania Lithuania 54.8 -1.52% 31
Luxembourg Luxembourg 55.1 -0.301% 28
Latvia Latvia 52.7 +0.287% 39
Moldova Moldova 70.4 -2.69% 2
Mexico Mexico 45 +3.25% 67
North Macedonia North Macedonia 37.6 +1.57% 76
Malta Malta 55.5 -9.6% 26
Mongolia Mongolia 50.4 -3.62% 51
Mauritius Mauritius 43.4 +12.3% 69
Netherlands Netherlands 61.7 +0.903% 8
Norway Norway 60 -0.443% 13
New Zealand New Zealand 64.9 +0.62% 6
Panama Panama 46.1 +2.74% 64
Peru Peru 61.3 -3.01% 9
Poland Poland 50.5 +1.59% 50
Portugal Portugal 51.7 +1.14% 44
Paraguay Paraguay 54.8 +1.16% 29
Romania Romania 39.8 -0.941% 71
Russia Russia 54.4 +2.03% 35
Rwanda Rwanda 49.8 +9.07% 53
Saudi Arabia Saudi Arabia 30.2 +3.51% 82
Singapore Singapore 60.3 -1.01% 11
El Salvador El Salvador 47.2 +5.14% 61
Serbia Serbia 47 +2.92% 62
Slovakia Slovakia 52.9 +0.628% 38
Slovenia Slovenia 51.8 -0.179% 42
Sweden Sweden 59.3 +1.15% 17
Seychelles Seychelles 59.8 -3.56% 15
Thailand Thailand 60.1 +1.52% 12
Tunisia Tunisia 21.2 -2.62% 83
Turkey Turkey 31.3 +2.98% 81
Uruguay Uruguay 50.7 +0.15% 48
United States United States 55.4 +1.13% 27
Vietnam Vietnam 66.9 -1.84% 5
South Africa South Africa 32.1 +5.46% 80
Zimbabwe Zimbabwe 56.2 +5.22% 24

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