Pupil-teacher ratio, primary

Source: worldbank.org, 01.09.2025

Year: 2018

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 48.8 +1.68% 5
Albania Albania 17.6 -2.07% 56
Andorra Andorra 10.5 -0.0231% 84
Armenia Armenia 15.4 -20.1% 68
Antigua & Barbuda Antigua & Barbuda 12.4 +2.9% 79
Azerbaijan Azerbaijan 15.4 -0.182% 67
Burundi Burundi 42.5 -14.3% 8
Benin Benin 39.2 -10% 14
Burkina Faso Burkina Faso 39.7 -2.36% 13
Bangladesh Bangladesh 30.1 +0.00010% 22
Bahrain Bahrain 11.9 -1.94% 82
Bahamas Bahamas 19.4 +2.21% 49
Bosnia & Herzegovina Bosnia & Herzegovina 16.9 -1.59% 59
Belarus Belarus 19.2 +2.29% 50
Belize Belize 19.8 +1.01% 47
Bolivia Bolivia 17.8 +1.19% 54
Barbados Barbados 14 -0.746% 73
Brunei Brunei 9.9 -2.82% 85
Bhutan Bhutan 34.7 +0.306% 19
China China 16.4 -1.01% 62
Côte d’Ivoire Côte d’Ivoire 41.8 -1.42% 9
Cameroon Cameroon 44.8 +0.495% 6
Colombia Colombia 23.3 -1.27% 39
Comoros Comoros 28.1 +48.4% 24
Cape Verde Cape Verde 21.1 -0.0377% 43
Costa Rica Costa Rica 12.2 +4.96% 80
Cuba Cuba 9.16 +3.77% 87
Cayman Islands Cayman Islands 15.7 +20.8% 65
Djibouti Djibouti 29.4 -3.44% 23
Dominican Republic Dominican Republic 18.9 +0.0332% 51
Algeria Algeria 24.3 +0.393% 36
Ecuador Ecuador 24.3 -0.89% 37
Egypt Egypt 23.7 -0.41% 38
Eritrea Eritrea 38.7 -1.29% 15
Georgia Georgia 8.98 -0.37% 88
Ghana Ghana 27.2 -0.186% 26
Gambia Gambia 36.1 -6.56% 18
Grenada Grenada 16.4 +1.04% 63
Guatemala Guatemala 20.3 +0.408% 46
Hong Kong SAR China Hong Kong SAR China 13.3 -3.06% 77
Indonesia Indonesia 17 +6.05% 58
Jamaica Jamaica 24.8 +12.2% 33
Jordan Jordan 18.5 -11.9% 52
Kazakhstan Kazakhstan 19.6 -5.38% 48
Kyrgyzstan Kyrgyzstan 25 +0.305% 32
Cambodia Cambodia 41.7 +0.098% 10
Kuwait Kuwait 8.88 +0.25% 89
Laos Laos 22.3 -0.00125% 40
St. Lucia St. Lucia 14.7 -3.23% 69
Sri Lanka Sri Lanka 21.7 -5.21% 41
Macao SAR China Macao SAR China 13.5 -0.0837% 75
Morocco Morocco 26.8 -4.4% 29
Monaco Monaco 11.4 +8.89% 83
Moldova Moldova 17.9 +1.36% 53
Madagascar Madagascar 39.8 -1.96% 12
Mali Mali 37.8 -1.03% 16
Myanmar (Burma) Myanmar (Burma) 24.4 +5.7% 35
Mongolia Mongolia 30.4 +0.0119% 21
Mozambique Mozambique 55.3 +5.41% 3
Mauritania Mauritania 34.3 -5.7% 20
Mauritius Mauritius 16.2 -9.7% 64
Malawi Malawi 58.7 -15.6% 2
Namibia Namibia 25.1 -15.7% 31
Oman Oman 9.67 -4.48% 86
Pakistan Pakistan 44.1 -1.57% 7
Peru Peru 17.4 -3.06% 57
North Korea North Korea 20.3 -1.14% 44
Palestinian Territories Palestinian Territories 24.5 -1.11% 34
Qatar Qatar 12.2 +3.34% 81
Rwanda Rwanda 59.5 +2.85% 1
Saudi Arabia Saudi Arabia 13.8 +13% 74
Senegal Senegal 36.3 +10.7% 17
Solomon Islands Solomon Islands 25.4 -1.43% 30
Sierra Leone Sierra Leone 27.5 -30.2% 25
El Salvador El Salvador 26.9 -4.87% 28
San Marino San Marino 6.93 +10.5% 90
Serbia Serbia 14.3 +0.0615% 72
Suriname Suriname 13.4 +3.63% 76
Seychelles Seychelles 14.5 +3.25% 70
Turks & Caicos Islands Turks & Caicos Islands 17.7 +90.5% 55
Togo Togo 40.1 +0.0471% 11
Thailand Thailand 16.6 -1.48% 61
Timor-Leste Timor-Leste 26.9 -2.55% 27
Tunisia Tunisia 16.9 +1.81% 60
Tuvalu Tuvalu 15.6 -9.41% 66
Tanzania Tanzania 50.6 +7.38% 4
Ukraine Ukraine 13 -0.111% 78
Uzbekistan Uzbekistan 21.5 +1.69% 42
St. Vincent & Grenadines St. Vincent & Grenadines 14.4 -0.00549% 71
Vietnam Vietnam 20.3 +3.21% 45

The pupil-teacher ratio (PTR) in primary education is a critical indicator of the quality and accessibility of education systems worldwide. It is defined as the number of pupils per teacher in a given educational setting and serves as a key measure for evaluating the teaching and learning environment within schools. A lower pupil-teacher ratio typically indicates that teachers can devote more time and attention to each student, which is essential for fostering a more personalized and engaging educational experience. Conversely, a higher ratio may suggest overcrowded classrooms, which can impede effective teaching and learning.

The importance of the pupil-teacher ratio extends beyond classroom dynamics. It is intricately linked to various educational and developmental outcomes. For instance, research has shown that smaller class sizes often correlate with improved student performance, higher levels of student engagement, and greater overall satisfaction among teachers and students. Moreover, lower ratios facilitate better classroom management and allow for more differentiated instruction, catering to the diverse needs of students.

Pupil-teacher ratios can also be analyzed in relation to other indicators of educational effectiveness, such as student enrollment rates, dropout rates, and educational attainment levels. For example, countries with lower pupil-teacher ratios often experience higher enrollment rates in primary education since parents are more likely to send their children to schools where they believe they will receive adequate attention from teachers. Additionally, when students are more engaged in their learning due to lower ratios, they are less likely to drop out, contributing to higher completion rates and educational attainment in the long run.

Several key factors influence pupil-teacher ratios across different regions. Economic development plays a significant role; wealthier nations typically have the resources to employ more teachers per capita. Conversely, developing countries may struggle with limited financial resources, leading to higher pupil-teacher ratios and, consequently, challenges in maintaining quality education. Infrastructure availability, government policies on education funding, and demographic factors such as population growth also contribute to varying ratios around the globe.

To address the challenges associated with high pupil-teacher ratios, various strategies can be employed. Governments and education policymakers should prioritize investment in teacher recruitment and retention, ensuring that schools can maintain a favorable ratio. Strategies such as offering competitive salaries, professional development opportunities, and incentives for teachers to work in underserved areas can help alleviate teacher shortages. Furthermore, innovative classroom approaches, such as team teaching or incorporating technology-based instruction, may also serve to effectively manage larger classes.

Despite the importance of the pupil-teacher ratio, there are flaws and limitations in solely relying on this indicator to gauge educational quality. While smaller class sizes can theoretically lead to better educational outcomes, other factors, such as curriculum quality, teacher training, and parental involvement, also significantly impact the learning experience. Thus, it is essential to consider pupil-teacher ratios within the broader context of a country's entire educational ecosystem.

To contextualize the global landscape of pupil-teacher ratios, we can examine the latest available data from 2019, which shows a median ratio of 18.48. This figure represents a slight improvement compared to historical trends. From 1970, when the world average pupil-teacher ratio was 28.11, there has been a gradual decrease in the average ratio, indicating a global shift towards prioritizing smaller class sizes. Throughout the decades, fluctuations in this metric have occurred, but the overall trend points to a slow but steady reduction in PTR.

Notably, the highest pupil-teacher ratios in 2019 have been reported in Ghana, at 26.99, followed closely by Nepal at 19.74. These figures suggest substantial classroom overcrowding in these regions, potentially hindering the quality of education that students receive. On the other hand, Monaco stands out with a remarkably low ratio of 11.7, an emblem of its commitment to quality education resource allocation. Kazakhstan, with a PTR of 17.21, also presents an interesting case, reflecting a balance between educational access and quality.

It's important to acknowledge that while the data provides valuable insight, factors such as regional disparities, socio-economic conditions, and policy decisions greatly influence these ratios. Countries like Ghana may experience challenges such as higher population growth and limited educational funding, which exacerbate issues related to teacher recruitment. In contrast, nations with strong economic foundations, like Monaco, can afford to maintain lower ratios, ensuring that each student benefits from personal attention in their formative years.

In summary, the pupil-teacher ratio is a vital indicator that influences primary education's quality, accessibility, and effectiveness. By understanding its implications and the factors affecting it, stakeholders can devise strategies to improve educational outcomes, ultimately contributing to a more equitable and prosperous society. Policymakers must continue to invest in education, acknowledging that quality teaching conditions foster meaningful learning experiences for students globally.

                    
# 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.ENRL.TC.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.PRM.ENRL.TC.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))