School enrollment, tertiary, female (% gross)

Source: worldbank.org, 03.09.2025

Year: 2023

Flag Country Value Value change, % Rank
Angola Angola 9.79 -6.55% 60
Albania Albania 77 +2.93% 9
Andorra Andorra 70.1 +99.6% 14
United Arab Emirates United Arab Emirates 70.2 +22.5% 13
Armenia Armenia 71.2 +4.19% 11
Azerbaijan Azerbaijan 46.1 +2.85% 32
Burundi Burundi 5.44 -0.983% 66
Burkina Faso Burkina Faso 8.19 +9.76% 62
Bangladesh Bangladesh 22 +5.33% 47
Bahrain Bahrain 87 -6.22% 6
Bosnia & Herzegovina Bosnia & Herzegovina 55.7 +1.01% 22
Belarus Belarus 71.4 -4.86% 10
Belize Belize 29.4 -4.69% 45
Bermuda Bermuda 20.4 -23.4% 49
Brunei Brunei 45.6 +10.3% 33
Bhutan Bhutan 14.9 -16.2% 55
Botswana Botswana 27.1 -2.95% 46
China China 81 +3.73% 8
Côte d’Ivoire Côte d’Ivoire 10.4 +9.58% 59
Cameroon Cameroon 14.3 -0.877% 56
Congo - Brazzaville Congo - Brazzaville 8.3 -15.5% 61
Cuba Cuba 64.5 +15.2% 17
Algeria Algeria 67.4 -0.873% 15
Egypt Egypt 39.5 +3.77% 36
Fiji Fiji 71 -12.3% 12
Georgia Georgia 87.5 +2.65% 5
Ghana Ghana 21.6 +9.19% 48
Guatemala Guatemala 30.5 +55.1% 44
Hong Kong SAR China Hong Kong SAR China 105 +4.37% 2
Indonesia Indonesia 50.2 +6.85% 27
India India 32.8 -1.34% 42
Jordan Jordan 40.4 +1.05% 35
Kazakhstan Kazakhstan 62.1 -4.62% 19
Kyrgyzstan Kyrgyzstan 61.7 +2.46% 20
Cambodia Cambodia 19.3 +37.1% 52
Laos Laos 12.8 -8.38% 57
Macao SAR China Macao SAR China 134 +10.6% 1
Morocco Morocco 51.6 +4.94% 26
Madagascar Madagascar 6.47 +4.27% 64
Montenegro Montenegro 66.9 -1.36% 16
Mongolia Mongolia 81.5 +1.25% 7
Malaysia Malaysia 47.7 +3.52% 30
Nicaragua Nicaragua 34.6 +55.3% 40
Nepal Nepal 19.9 +33.9% 50
Oman Oman 55.9 +5.49% 21
Pakistan Pakistan 11 +5.94% 58
Philippines Philippines 53.4 +12.9% 24
Palau Palau 41.9 -7.62% 34
Puerto Rico Puerto Rico 101 -14.7% 3
Palestinian Territories Palestinian Territories 53.7 -3.33% 23
Rwanda Rwanda 7.74 +20.8% 63
Senegal Senegal 17.6 +6.39% 54
El Salvador El Salvador 37.2 +3.1% 37
San Marino San Marino 48.2 -1.18% 29
Serbia Serbia 87.7 +2.86% 4
Sint Maarten Sint Maarten 6.11 +7.76% 65
Seychelles Seychelles 18.6 -5.24% 53
Turks & Caicos Islands Turks & Caicos Islands 33.1 +41% 41
Thailand Thailand 53.1 +5.22% 25
Tajikistan Tajikistan 36.1 -1.15% 39
Timor-Leste Timor-Leste 32.2 +118% 43
Tonga Tonga 63.5 +120% 18
Tunisia Tunisia 49.2 +2.56% 28
Tanzania Tanzania 4.7 -3.72% 67
Uzbekistan Uzbekistan 46.5 +58.9% 31
British Virgin Islands British Virgin Islands 36.3 -7.34% 38
Samoa Samoa 19.6 -14.8% 51

                    
# 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 = 'SE.TER.ENRR.FE'

# 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 <- 'SE.TER.ENRR.FE'

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