School enrollment, primary (% net)

Source: worldbank.org, 01.09.2025

Year: 2017

Flag Country Value Value change, % Rank
Albania Albania 95.5 +1.58% 54
United Arab Emirates United Arab Emirates 95 +0.503% 62
Argentina Argentina 99.2 +0.083% 10
Armenia Armenia 91.9 -0.318% 91
Antigua & Barbuda Antigua & Barbuda 94.2 +0.0306% 72
Australia Australia 96.4 -0.278% 39
Austria Austria 88.6 -0.253% 101
Azerbaijan Azerbaijan 93.7 -1.24% 75
Burundi Burundi 94.9 -0.523% 66
Belgium Belgium 98.8 +0.479% 15
Benin Benin 97 +0.698% 33
Burkina Faso Burkina Faso 76.4 +1.62% 127
Bulgaria Bulgaria 86.4 -1.3% 108
Bahrain Bahrain 97.3 +1.05% 30
Belarus Belarus 95.6 -0.484% 52
Belize Belize 96.2 +0.0691% 45
Bolivia Bolivia 90.9 +2.32% 94
Brazil Brazil 96.3 +0.867% 43
Barbados Barbados 95 -0.458% 63
Brunei Brunei 93.5 -0.233% 80
Bhutan Bhutan 87.4 -0.12% 104
Canada Canada 99.9 -0.0734% 2
Switzerland Switzerland 93.2 -0.365% 83
Chile Chile 94.7 +0.781% 68
Côte d’Ivoire Côte d’Ivoire 85.6 +2.89% 114
Cameroon Cameroon 92.9 -1.71% 87
Colombia Colombia 93.1 +0.149% 84
Comoros Comoros 79.8 -1.25% 125
Cape Verde Cape Verde 92.9 +0.29% 88
Costa Rica Costa Rica 96.3 -1.88% 40
Cuba Cuba 95.6 +1.18% 53
Cyprus Cyprus 97.5 +0.79% 28
Czechia Czechia 89.4 +0.623% 100
Germany Germany 90.1 -0.304% 97
Djibouti Djibouti 60 +4.74% 135
Denmark Denmark 98.5 -0.158% 18
Dominican Republic Dominican Republic 92.9 -0.487% 86
Algeria Algeria 97.6 -0.00256% 26
Ecuador Ecuador 91.6 -0.0206% 92
Egypt Egypt 97 -0.442% 34
Eritrea Eritrea 51.8 -13.4% 136
Spain Spain 97.3 -1.54% 31
Estonia Estonia 93.7 +0.211% 77
Finland Finland 98.6 -0.431% 17
France France 98.9 +0.107% 14
United Kingdom United Kingdom 99.5 -0.161% 8
Georgia Georgia 97.9 +0.0343% 23
Ghana Ghana 85.2 -1.39% 115
Gambia Gambia 76.1 +3.33% 128
Greece Greece 98.2 +0.284% 21
Guatemala Guatemala 85.6 +1.17% 113
Hong Kong SAR China Hong Kong SAR China 95.7 -0.668% 49
Honduras Honduras 80.1 +0.644% 123
Croatia Croatia 88 +0.46% 102
Hungary Hungary 90.8 -0.617% 95
Indonesia Indonesia 94.1 +1.43% 73
Ireland Ireland 95.8 -0.0952% 48
Iran Iran 99.7 -0.00657% 4
Iceland Iceland 99.8 +0.381% 3
Israel Israel 97 +0.295% 35
Italy Italy 95.7 -0.366% 51
Jamaica Jamaica 82.5 -1.83% 120
Jordan Jordan 80.1 +4.35% 124
Kazakhstan Kazakhstan 86.2 -1.28% 109
Kyrgyzstan Kyrgyzstan 89.9 +0.586% 98
Cambodia Cambodia 90.5 -2.39% 96
Kiribati Kiribati 94.7 -2.86% 69
South Korea South Korea 97.3 +0.406% 32
Kuwait Kuwait 85.9 -5.23% 112
Laos Laos 92.5 -1.61% 89
Liberia Liberia 44.3 +15.3% 137
St. Lucia St. Lucia 94.9 +0.0168% 67
Sri Lanka Sri Lanka 99.1 +0.198% 13
Lesotho Lesotho 93.3 +3.02% 81
Lithuania Lithuania 98.2 -0.112% 22
Luxembourg Luxembourg 95 -0.528% 61
Latvia Latvia 96.3 +0.312% 42
Macao SAR China Macao SAR China 96.8 +0.0565% 38
Morocco Morocco 96.9 +2.41% 37
Moldova Moldova 86.5 -0.433% 107
Maldives Maldives 95.4 -0.875% 55
Mexico Mexico 95.3 -0.408% 56
North Macedonia North Macedonia 94.9 +3.46% 65
Mali Mali 61.3 +7.54% 133
Malta Malta 99.5 +1.09% 7
Myanmar (Burma) Myanmar (Burma) 97.7 +1.59% 25
Montenegro Montenegro 95.7 +2.26% 50
Mongolia Mongolia 97.9 +0.0497% 24
Mozambique Mozambique 89.9 -0.984% 99
Mauritania Mauritania 77.8 +6.44% 126
Mauritius Mauritius 95.8 +0.912% 46
Malaysia Malaysia 99.6 -0.175% 6
Namibia Namibia 97.3 +0.118% 29
Niger Niger 65.1 +2.44% 131
Netherlands Netherlands 98.6 +1.36% 16
Norway Norway 99.9 +0.0767% 1
Nepal Nepal 96.3 -1.88% 41
New Zealand New Zealand 99.1 +0.66% 12
Oman Oman 93.3 -1.82% 82
Pakistan Pakistan 64.9 -0.798% 132
Panama Panama 86.2 -1.2% 110
Peru Peru 94.9 -0.389% 64
Philippines Philippines 93.8 -0.626% 74
Poland Poland 95.8 -0.23% 47
Portugal Portugal 97.6 +0.855% 27
Palestinian Territories Palestinian Territories 95.3 +1.51% 57
Qatar Qatar 93.5 +0.56% 79
Romania Romania 82.2 -2.23% 121
Russia Russia 95.1 -1.69% 60
Rwanda Rwanda 96.9 -1.93% 36
Saudi Arabia Saudi Arabia 95.2 -1.46% 58
Sudan Sudan 60 +1.4% 134
Senegal Senegal 75.4 +2.51% 129
Singapore Singapore 99.7 -0.0255% 5
Solomon Islands Solomon Islands 69.5 -3.98% 130
El Salvador El Salvador 80.2 -5% 122
Serbia Serbia 95.2 -0.577% 59
São Tomé & Príncipe São Tomé & Príncipe 93.1 +5.83% 85
Suriname Suriname 86.1 -3.44% 111
Slovakia Slovakia 83.1 +1.11% 118
Slovenia Slovenia 98.3 +0.147% 20
Sweden Sweden 99.2 -0.168% 11
Eswatini Eswatini 82.5 -2.05% 119
Seychelles Seychelles 92 -2.13% 90
Togo Togo 90.9 +1.17% 93
Tajikistan Tajikistan 98.3 +1.75% 19
Timor-Leste Timor-Leste 93.7 +1.73% 76
Turkey Turkey 87.9 -6.54% 103
Tanzania Tanzania 83.6 +0.0907% 116
Uruguay Uruguay 99.4 -0.224% 9
United States United States 94.6 -0.47% 70
Uzbekistan Uzbekistan 96.3 +1.22% 44
St. Vincent & Grenadines St. Vincent & Grenadines 93.6 +0.4% 78
Venezuela Venezuela 87.4 -1.68% 105
Samoa Samoa 94.5 -0.419% 71
South Africa South Africa 87 +3.15% 106
Zambia Zambia 83.2 -3.98% 117

The indicator 'School enrollment, primary (% net)' is a critical measure reflecting the percentage of children of official primary school age who are enrolled in primary education, as a proportion of the total number of children in that age group. This data is essential for assessing the accessibility and quality of education systems worldwide and plays a significant role in shaping education policy decisions. The importance of this indicator cannot be overstated, as it serves as a barometer not only for educational engagement but also for broader socio-economic conditions within a nation.

The importance of primary school enrollment extends beyond the straightforward act of education. High levels of enrollment correlate with improved literacy rates, a more skilled workforce, and ultimately, economic growth. Furthermore, education is pivotal for fostering gender equality, reducing poverty, and promoting social cohesion. When children are educated, they are more likely to contribute positively to their communities, thereby reinforcing the cycle of sustainable development.

This indicator also interacts with several other factors, including economic stability, societal norms, and governmental policies. In many countries, higher levels of school enrollment can be linked to effective governance and targeted educational interventions. For example, nations that have invested in educational infrastructure and incentives for families—such as free textbooks or meal programs—often report higher enrollment percentages. Conversely, countries grappling with economic hardship may struggle to keep their enrollment rates high due to financial barriers preventing families from sending children to school.

Societal factors also play a crucial role in influencing enrollment rates. Cultural attitudes towards education, particularly concerning gender roles, can significantly affect a child's likelihood of attending school. In regions where families prioritize boys’ education over girls’, the enrollment rate might disproportionately favor boys. Thus, advocacy for inclusive education policies that target marginalized groups is vital to ensure that every child has an opportunity to learn.

In 2019, the world saw a median primary school enrollment rate of 86.51%. This figure indicates a commendable global effort towards educational inclusivity; however, it also highlights disparities that persist in various regions. For instance, while Nepal led the charge with a notable net enrollment rate of 96.3%, marking it as one of the front-runners in educational access, this also emphasizes the challenges faced by countries like Djibouti, where the enrollment rate was significantly lower at 66.48%. These sharp contrasts between top performers and those struggling illustrate the critical need for countries to tailor their education policies and allocate resources effectively to address gaps in enrollment.

The top five areas for primary school enrollment in 2019 included Nepal, Kazakhstan (86.86%), Ghana (86.16%), and Djibouti (66.48%). While Nepal demonstrated exemplary performance, the ratings for Kazakhstan and Ghana suggest a mixed landscape where only marginal improvements are being made. Clearly, the stark difference in Djibouti's figure underscores systemic issues that require immediate and focused intervention. Furthermore, the positioning of Ghana and Kazakhstan in both the top and bottom rankings in the context of various reports shows a trend towards stagnation or minimal improvement in some cases, indicating potential flaws in the educational strategies employed.

Several key strategies can be employed to bolster school enrollment rates. Increasing public awareness around the importance of education, particularly in underprivileged communities, can facilitate shifts in societal attitudes that inhibit enrollment. Local governments can play an instrumental role by engaging community leaders to advocate for educational participation, particularly among marginalized populations. Improving the quality of schools through investments in teacher training and curriculum development can also help increase enrollment rates, as families are more likely to send their children to schools where they anticipate a high-quality education.

Providing financial incentives for low-income families, eliminating school fees, offering meal programs, and improving school infrastructure are all effective methods to boost enrollment. Furthermore, strong data collection systems can track enrollment trends and pinpoint specific areas needing attention, ensuring that strategies remain adaptable and effective over time.

Despite the myriad of efforts to enhance school enrollment, there are inherent flaws present in current approaches. For instance, many nations still grapple with systemic inequalities that become barriers to educational access. Discrimination based on gender, socio-economic status, and geographic location can skew enrollment rates unfavorably, leaving entire demographics overshowered. Moreover, an overemphasis on enrollment figures can sometimes overshadow critical issues such as educational quality. A school might maintain high enrollment rates, yet if the curriculum is inadequate or poorly delivered, true educational outcomes remain unachieved.

In conclusion, 'School enrollment, primary (% net)' is a vital indicator reflecting broader global commitments to education, equality, and development. While progress has been made, the disparities illuminated by the data underscore the ongoing challenges that many nations face. Comprehensive strategies must address not only the enrollment figures but also the quality of education delivered. If countries can work together to enhance educational access and equity, future generations will be better equipped to tackle the complex challenges that lie ahead.

                    
# 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.PRM.NENR'

# 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.PRM.NENR'

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