Secondary education, pupils (% female)

Source: worldbank.org, 03.09.2025

Year: 2018

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 35.1 +0.256% 77
Albania Albania 47.1 +0.0255% 67
Andorra Andorra 48.3 -0.602% 53
Armenia Armenia 47.3 -0.603% 66
Antigua & Barbuda Antigua & Barbuda 48.5 -0.504% 51
Azerbaijan Azerbaijan 46.7 -8.86% 69
Burundi Burundi 52.7 +2.91% 2
Burkina Faso Burkina Faso 49.1 +1.47% 37
Bangladesh Bangladesh 52.6 -0.303% 3
Bahrain Bahrain 48.8 -0.316% 47
Bahamas Bahamas 51.7 +1.96% 9
Bosnia & Herzegovina Bosnia & Herzegovina 49.4 +0.174% 34
Belarus Belarus 48.3 +0.0566% 56
Belize Belize 50.6 -0.716% 20
Bolivia Bolivia 48.5 -0.0033% 52
Barbados Barbados 49.6 -0.0473% 32
Brunei Brunei 49 +0.159% 39
Bhutan Bhutan 52 +0.677% 5
China China 46.9 -0.219% 68
Côte d’Ivoire Côte d’Ivoire 43.5 +1.8% 76
Colombia Colombia 50.2 -0.213% 24
Comoros Comoros 50.8 +0.21% 16
Cape Verde Cape Verde 52.2 +0.379% 4
Costa Rica Costa Rica 50.7 +0.146% 17
Cuba Cuba 49 -0.192% 40
Cayman Islands Cayman Islands 49.7 -0.604% 29
Djibouti Djibouti 45.1 +0.415% 72
Dominican Republic Dominican Republic 51.3 -0.334% 12
Ecuador Ecuador 49.7 -0.00147% 30
Egypt Egypt 48.2 +0.155% 57
Eritrea Eritrea 46.7 +0.532% 70
Georgia Georgia 47.3 +0.301% 65
Ghana Ghana 48.5 +0.634% 50
Grenada Grenada 49.8 -0.606% 25
Guatemala Guatemala 47.8 +0.0937% 61
Hong Kong SAR China Hong Kong SAR China 47.6 +0.15% 63
Indonesia Indonesia 49.2 -0.0645% 36
India India 48.1 +1.21% 59
Jamaica Jamaica 49.7 -0.976% 27
Jordan Jordan 50.4 +0.0905% 23
Kazakhstan Kazakhstan 48.9 -0.0484% 43
Kyrgyzstan Kyrgyzstan 49 +0.092% 38
Laos Laos 47.6 +0.339% 64
Lebanon Lebanon 51.2 +0.717% 13
St. Lucia St. Lucia 49.8 -0.401% 26
Sri Lanka Sri Lanka 51.1 -0.204% 14
Macao SAR China Macao SAR China 48.3 -0.235% 55
Morocco Morocco 46.6 +1.23% 71
Monaco Monaco 49 +0.119% 41
Moldova Moldova 48.3 -0.118% 54
Madagascar Madagascar 50.6 +0.787% 19
Mali Mali 44.5 +0.965% 73
Myanmar (Burma) Myanmar (Burma) 51.9 -0.249% 7
Montenegro Montenegro 48 -0.111% 60
Mauritania Mauritania 49.7 +0.654% 28
Mauritius Mauritius 50.4 -0.736% 22
Malawi Malawi 49.5 +2.3% 33
Malaysia Malaysia 50.5 +1.2% 21
Oman Oman 48.6 -0.34% 49
Pakistan Pakistan 44 +2.74% 75
Peru Peru 48.9 +0.164% 45
Palestinian Territories Palestinian Territories 51.4 +0.302% 10
Qatar Qatar 48.9 -0.178% 42
Rwanda Rwanda 53.2 +0.105% 1
Saudi Arabia Saudi Arabia 47.6 +2.39% 62
Senegal Senegal 51.9 +0.229% 8
El Salvador El Salvador 49.4 +0.0305% 35
San Marino San Marino 44.5 -7.5% 74
Serbia Serbia 48.8 +0.121% 46
Seychelles Seychelles 50.6 -2.21% 18
Turks & Caicos Islands Turks & Caicos Islands 49.7 -3.7% 31
Thailand Thailand 48.2 +0.961% 58
Timor-Leste Timor-Leste 51.3 +0.623% 11
Tuvalu Tuvalu 52 -1.41% 6
Tanzania Tanzania 50.8 +1.13% 15
Ukraine Ukraine 48.7 +0.0967% 48
St. Vincent & Grenadines St. Vincent & Grenadines 48.9 +1.31% 44

The indicator "Secondary education, pupils (% female)" represents the percentage of female pupils enrolled in secondary education compared to the total number of pupils at that level. This ratio is an important metric for assessing gender parity in education, one of the vital components of societal development and equality. Education is universally acknowledged as a foundation for personal growth, economic stability, and a catalyst for social progress. Achieving gender parity in secondary education is not merely a goal but a fundamental human right that has profound implications for a country's overall development.

The significance of this indicator extends beyond education; it relates to multiple areas, including gender equality, labor market participation, and social equity. Higher female enrollment rates often correlate with better economic metrics, as educated women are more likely to participate in the workforce, contributing to a nation’s economic growth. Furthermore, communities where girls are educated typically experience lower rates of poverty, improved health outcomes, and greater civic participation. In contrast, countries that fail to achieve gender parity in education may struggle with social cohesion and face a myriad of developmental challenges.

This indicator also interrelates with others, such as literacy rates, secondary school completion rates, and overall educational investment by governments. A country with high female enrollment in secondary education is likely investing significantly in education and gender equality initiatives. This investment would, in turn, foster an environment where educational attainment translates into economic opportunities for women, ultimately elevating their roles in various professional fields and enhancing their community's well-being.

Several factors can influence the percentage of female pupils in secondary education. Cultural norms can significantly affect female enrollment, particularly in regions where traditional gender roles prioritize males’ education. Economic barriers are also notable, as some families may prioritize boys’ schooling over girls due to limited resources. Moreover, geographical location plays a role; in rural areas, girls may face additional obstacles, including long distances to schools and safety concerns that discourage attendance. Additionally, policy frameworks can either facilitate or hinder female education; countries with strong legal frameworks supporting girls' education often achieve better results.

Strategies to improve female enrollment in secondary education can include implementing scholarship programs aimed at families in poverty, creating safe transportation options to and from school, and increasing the availability of female educators who can serve as role models. Community engagement initiatives that emphasize the importance of female education can also help in challenging existing cultural norms. Governments and NGOs can work collaboratively to develop policies that promote inclusivity in schooling by providing specific support targeted to enhance girls' educational opportunities.

Despite the noteworthy progress made globally, there exist flaws in measuring this indicator. One significant issue is the reliance on enrollment figures rather than completion rates, which may mask the realities faced by girls who drop out before finishing their education. Furthermore, disparities can exist between urban and rural settings, so a national average may hide troubling inequalities that necessitate more granular analysis. By focusing disproportionately on the percentage of enrollment, policymakers might overlook underlying challenges that still prevent girls from accessing education on equal footing with boys.

As of 2019, the median value of female enrollment in secondary education globally stood at 48.96%. This figure indicates that, in many parts of the world, females are just shy of achieving parity with male pupils at this educational level. The top five areas in terms of female pupils in secondary education highlight both progress and inconsistencies in achieving gender parity. For instance, Nepal leads with 51.43%, a figure suggesting substantial efforts to promote girls' education. In contrast, among the bottom five, areas such as Djibouti and Ghana represent challenges that still need to be addressed. For example, Djibouti shows only 45.78% female enrollment, likely reflecting cultural and economic barriers that hinder girls' access to education.

The broader context of global values from 1970 to 2019 paints a picture of gradual progress. The world value of female enrollment was a mere 42.04% in 1970, with a steady but slow rise over the decades, culminating in the current median. This increase reflects the ongoing dedication to improving gender equality in education worldwide yet underscores how much work remains to be done to close the gap completely.

In summation, the percentage of female pupils in secondary education is a significant indicator of gender equality and societal progress. While global trends show improvements, regional discrepancies indicate ongoing work is needed. By implementing strategic initiatives and fostering environments conducive to female education, societies can continue to move toward achieving true educational equity. The journey toward complete gender parity may be long, but each incremental step forward is a victory worth striving for, benefitting not just the individuals involved but society as a whole.

                    
# 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.SEC.ENRL.FE.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 <- 'SE.SEC.ENRL.FE.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))