Skip to content
Field Guide

Who gets left behind?

Rural against urban, women against men, in the same year.

1:37 Captions in the video Python Recorded 14 October 2026

YouTube
Lesson 4 of 6 · Analyse it in Python Next: Numbers you can defend

Try it yourself

  • Python, after import undata as un
    COMPLETION = "undata/sdg/SE_TOT_CPLR.EDUCATION_LEVEL--ISCED11_1"
    un.breakdowns(COMPLETION)
    gap = un.gap(COMPLETION,
                 ["Chad", "Niger", "Mali", "Nigeria", "Ghana", "Bangladesh", "Nepal"],
                 by="urbanization")
    un.chart(gap, "rural-urban-gap.png")
  • Open the rural-urban gap use case in Colab

Remember: Compare two groups within the same year, or the gap is one survey against another.

Transcript

  1. National averages hide people. Leaving no one behind means looking at the gaps: between towns and villages, women and men, the poorest and the richest. Here is how to measure one, properly.
  2. Start by asking what an indicator can be split by. Here, primary school completion. un.breakdowns lists every breakdown the agency publishes: by sex, by rural and urban area, and by wealth, in fifths.
  3. un.gap compares two groups across countries. Choose the breakdown, here urbanization. For each country it takes the latest year in which both groups have a value, so the gap is never one survey against another. You get both values, the ratio, and the difference.
  4. In Chad, 19 percent of rural children finish primary school, against 55 percent in towns. A rural child is about a third as likely to finish. Niger and Mali show the same pattern. But in Bangladesh, rural children are slightly ahead, and Nepal is close to parity. So a gap like Chad’s is not inevitable.
  5. un.chart sorts the countries by the gap, and prints the ratio and the year beside each one. Chad’s figure is from 2019; the others are more recent, and the chart says so.
  6. And the summary states the finding: where the gap is widest, and which countries are at parity. The sentence in your report comes straight from the data.
  7. Change one word to compare girls and boys, or the poorest fifth with the richest, wherever the agency publishes that breakdown.
  8. Gaps measured like with like, in the same year. Next: the safeguards that make these numbers defensible.

Go deeper

↑ ↓ to move · Enter to open · A match inside a video opens the lesson at the moment the words are said.