Secondary education, general pupils

Source: worldbank.org, 03.09.2025

Year: 2018

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 3,041,987 +5.78% 12
Albania Albania 248,267 -4.29% 56
Andorra Andorra 4,025 -0.691% 85
Armenia Armenia 215,307 -0.283% 58
Antigua & Barbuda Antigua & Barbuda 7,574 -0.0396% 83
Azerbaijan Azerbaijan 792,449 +2.24% 34
Burundi Burundi 606,024 +1.34% 41
Burkina Faso Burkina Faso 1,252,441 +10.6% 25
Bangladesh Bangladesh 15,112,531 +2.79% 3
Bahrain Bahrain 92,483 +1.29% 66
Bahamas Bahamas 26,884 -12.5% 76
Bosnia & Herzegovina Bosnia & Herzegovina 153,157 -2.36% 62
Belarus Belarus 566,765 +1.33% 44
Belize Belize 37,052 +1.45% 74
Bolivia Bolivia 445,168 +1.86% 46
Barbados Barbados 19,571 -3.35% 79
Brunei Brunei 38,822 -2.93% 72
Bhutan Bhutan 74,638 +0.988% 67
China China 68,394,471 +1.45% 1
Côte d’Ivoire Côte d’Ivoire 1,923,876 +7.41% 21
Colombia Colombia 4,458,296 +0.731% 8
Comoros Comoros 73,695 +9.97% 68
Cape Verde Cape Verde 52,143 -5.18% 71
Costa Rica Costa Rica 368,090 +4.14% 49
Cuba Cuba 587,467 -4% 42
Cayman Islands Cayman Islands 3,476 +2.63% 86
Djibouti Djibouti 60,125 +5.15% 69
Dominican Republic Dominican Republic 849,143 -3.06% 33
Algeria Algeria 4,075,023 +1.68% 10
Ecuador Ecuador 1,621,831 -0.157% 23
Egypt Egypt 7,118,450 +1.82% 6
Eritrea Eritrea 257,599 +5.25% 55
Georgia Georgia 269,772 +2.33% 54
Ghana Ghana 2,605,193 +4.56% 16
Gambia Gambia 163,065 +5.43% 61
Grenada Grenada 9,135 +3.41% 82
Guatemala Guatemala 875,321 -0.082% 32
Hong Kong SAR China Hong Kong SAR China 341,591 -2.17% 51
Indonesia Indonesia 19,989,539 +1.8% 2
Jamaica Jamaica 200,563 -1.72% 59
Jordan Jordan 766,641 +4.01% 36
Kazakhstan Kazakhstan 1,643,803 +4.43% 22
Kyrgyzstan Kyrgyzstan 620,568 +2.23% 40
Cambodia Cambodia 955,656 +5.55% 30
Kuwait Kuwait 324,426 +2.05% 53
Laos Laos 671,064 +0.0741% 39
Lebanon Lebanon 339,951 +1.13% 52
St. Lucia St. Lucia 11,655 -3.41% 80
Sri Lanka Sri Lanka 2,622,100 +2.87% 15
Macao SAR China Macao SAR China 25,672 -3.06% 77
Morocco Morocco 2,624,844 +0.225% 14
Monaco Monaco 3,118 +0.841% 87
Moldova Moldova 195,480 +0.559% 60
Madagascar Madagascar 1,512,115 +0.747% 24
Mali Mali 918,775 +3.8% 31
Myanmar (Burma) Myanmar (Burma) 4,179,394 +5.41% 9
Montenegro Montenegro 38,029 -2.12% 73
Mozambique Mozambique 1,196,538 +8.39% 26
Mauritania Mauritania 235,653 +17% 57
Mauritius Mauritius 110,715 +0.12% 64
Malawi Malawi 1,040,975 +4.21% 28
Malaysia Malaysia 2,307,875 -2.85% 18
Niger Niger 775,930 +6.27% 35
Oman Oman 420,787 +42.3% 48
Pakistan Pakistan 12,911,242 +6.06% 4
Peru Peru 2,724,885 -0.0703% 13
Palestinian Territories Palestinian Territories 759,599 +1.45% 37
Qatar Qatar 106,817 +4.35% 65
Rwanda Rwanda 569,711 +7.21% 43
Saudi Arabia Saudi Arabia 3,087,264 +2.26% 11
Senegal Senegal 1,061,581 +1.25% 27
Solomon Islands Solomon Islands 52,566 -0.354% 70
Sierra Leone Sierra Leone 522,036 +7.01% 45
El Salvador El Salvador 429,923 -2.57% 47
San Marino San Marino 1,545 -17.3% 89
Serbia Serbia 348,468 -0.68% 50
Suriname Suriname 32,996 +2.21% 75
Seychelles Seychelles 7,371 +3.47% 84
Turks & Caicos Islands Turks & Caicos Islands 2,316 +15.1% 88
Togo Togo 711,617 +3.77% 38
Thailand Thailand 5,609,433 -1.32% 7
Timor-Leste Timor-Leste 141,712 +3.04% 63
Tunisia Tunisia 962,180 +0.998% 29
Tuvalu Tuvalu 1,070 -1.56% 90
Tanzania Tanzania 2,140,442 +11.9% 20
Ukraine Ukraine 2,199,778 +2.03% 19
Uzbekistan Uzbekistan 2,582,848 +1.89% 17
St. Vincent & Grenadines St. Vincent & Grenadines 9,808 -3.02% 81
Vietnam Vietnam 7,882,203 +2.2% 5
Samoa Samoa 25,583 -1.66% 78

The indicator of 'Secondary education, general pupils' is a crucial statistical measure that reflects the number of students enrolled in general secondary education programs across various regions worldwide. This indicator is significant because it serves as a foundation for understanding educational accessibility and the preparedness of a nation's youth to participate in the workforce or pursue further education. High enrollment figures can indicate a country’s emphasis on education as a human right and its efforts to develop a knowledgeable population capable of contributing to economic and social growth.

In 2019, the median value of pupils enrolled in secondary education globally was approximately 1,724,786. This figure provides context for understanding both the impact and importance of education on development at various levels, from the individual to the national scale. However, analyzing this figure in relation to specific countries provides deeper insights into educational disparities and trends.

For instance, Nepal led in secondary education enrollment with approximately 3,421,508 pupils, highlighting its commitment to expanding educational opportunities despite being classified as a developing nation. Ghana, following closely with 2,774,390 pupils, signifies advancements in education in sub-Saharan Africa, a region often challenged by resource limitations. Kazakhstan, with the median value, represents a balance between developed and developing educational infrastructure. Conversely, Djibouti and Monaco present interesting contrasts. Djibouti’s low enrollment of 60,822 pupils might reflect its economic challenges and infrastructural issues, while Monaco's figure of 3,075 highlights the small population and possibly exclusive educational opportunities in this affluent nation.

The relationships between this secondary education indicator and other societal metrics are profound. For example, regions with higher secondary school enrollment rates generally observe lower poverty levels and improved health outcomes. Education is intricately linked with economic development, workforce readiness, and social equity. The knowledge and skillsets acquired during secondary education can lead to better employment prospects and enhanced overall quality of life.

Several factors can significantly affect secondary education enrollment figures. Economic conditions play a pivotal role; in areas with socioeconomic instability, families may prioritize immediate income over educational investment. Gender disparity is another critical factor; in some regions, girls may face additional barriers to education due to cultural norms or safety concerns. Government policies, funding for education, and systemic inequalities also contribute to the fluctuation in enrollment figures. Countries that prioritize education in terms of budget allocation and policy formulation, like Ghana, tend to achieve better outcomes, while those that neglect it may lag, as evidenced in regions like Djibouti.

Strategies to enhance secondary education enrollment can take many forms, focusing on both accessibility and quality. Increasing funding for educational resources, ensuring the availability of qualified teachers, and creating safe learning environments are essential strategies. Scholarships and financial assistance for underprivileged families can also enhance enrollment, particularly for girls and children from economically disadvantaged backgrounds. Implementing community outreach programs that educate families on the value of secondary education is also vital to change perceptions and encourage enrollment.

Solutions also need to be sustainable and adaptable. Countries must continuously evaluate their educational policies to respond to changing demographics, economic conditions, and technological advancements. Innovations such as online learning platforms can cater to remote areas, making secondary education more accessible. However, digital divide issues must be addressed to ensure equitable access to these technologies.

Despite the apparent benefits of bolstering secondary education enrollment, flaws exist in how this indicator is used and interpreted. Overreliance on enrollment figures without assessing educational quality can paint an incomplete picture. Simply having a high number of students enrolled does not guarantee effective learning or skills acquisition. Furthermore, the measurement itself can be inconsistent, as different countries may define enrollment differently, potentially leading to inaccuracies in comparison.

Examining historical data further illustrates the evolution of secondary education globally. From 161 million students engaged in secondary education worldwide in 1970, the numbers rose steadily to 532 million by 2018. This upward trend highlights a global shift towards prioritizing education, driven by various factors, including increased investments, the recognition of education's role in national development, and international initiatives aimed at promoting universal access to quality education.

However, the rate of growth in secondary education enrollment must be tempered with an evaluation of quality. Increased enrollment without improvements in education quality or outcomes can lead to a workforce that may lack the competencies required in an increasingly complex global economy.

In conclusion, while the indicator of 'Secondary education, general pupils' serves as a significant measure of educational access and priorities globally, it necessitates a multidimensional approach to reflect true progress. By understanding the importance of this indicator in relation to social equity, economic development, and individual well-being, stakeholders can work towards creating a more balanced and effective educational landscape. Addressing the interrelated factors and implementing targeted strategies will ensure that the enrollment figures translate into meaningful educational experiences and outcomes for young people around the world.

                    
# 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.GC'

# 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.GC'

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