Get started

Install geo4bolivia, find a variable, load it, map it and run a first spatial analysis, in ten minutes.

✨ Run this page yourself: nothing to install on your computer.

▶ Open in Colab

geo4bolivia gives you the data of the GeoDevelopment Observatory of Bolivia and the standard analyses of spatial data science in one package. This page takes one indicator, the Sustainable Development Index of Bolivia’s 343 municipalities, from finding it to a first spatial result.

Install

In Google Colab or any Python 3.11+ environment:

!pip install -q geo4bolivia
import geo4bolivia as geo

The default install covers loading, maps and the core analyses. A few methods need an extra library, which you add only when you use them:

Extra Adds For
geo4bolivia[dynamics] giddy transitions, spatial_transitions
geo4bolivia[mgwr] mgwr mgwr
geo4bolivia[panel] linearmodels panel_model
geo4bolivia[raster] rasterio zonal
geo4bolivia[all] all of them everything

1. Find the data

geo.datasets() is the catalog: one row per dataset, with its years and the number of units that have data.

geo.datasets()[["dataset", "title", "years", "units", "variables"]].head(6)
dataset title years units variables
0 pop Population 2001–2020 333 2
1 ntl Night-time lights per capita 2012–2020 333 2
2 sdg Sustainable Development Index, IDS (SDG Atlas ... 2012, 2024 343 4
3 sdg01 SDG 1: No poverty (SDG Atlas of Bolivia 2026) 2012, 2024 343 5
4 sdg02 SDG 2: Zero hunger (SDG Atlas of Bolivia 2026) 2012, 2024 343 8
5 sdg03 SDG 3: Good health and well-being (SDG Atlas o... 2012, 2024 343 8

You do not need to know where a variable lives. geo.search() looks through the names, labels and descriptions of every variable of every dataset:

geo.search("sustainable development index")[["dataset", "variable", "label", "years", "units"]]
dataset variable label years units
0 sdg index_sdg Sustainable Development Index, IDS (0-100) 2012, 2024 343

geo.info() documents a dataset: what it is, its sources and their licenses, and how to cite it.

geo.info("sdg")

Sustainable Development Index, IDS (SDG Atlas of Bolivia 2026) sdg

The Sustainable Development Index (IDS) of the Atlas de los ODS en Bolivia 2026 (SDSN Bolivia), which summarises 81 indicators of 15 Sustainable Development Goals, and its national ranking, for Bolivia's 343 municipalities and indigenous autonomies (GAIOC), near the 2012 census and near the 2024 census (stored as 2012 and 2024), with the census population of both years and the 2024 urbanization rate as context.

Coverage

  • 343 municipality units, 2012, 2024, 4 variables

Actual years behind the stored years

  • 2012: ~2012; 2024: ~2024 (2 variables)
  • 2012: 2012; 2024: 2024 (1 variables)
  • 2024: 2024 (1 variables)

License of the published files

  • Creative Commons Attribution 4.0 International License

Sources

  • Andersen, L. E., & Argandoña, F. (2026). Atlas de los ODS en Bolivia 2026: Brechas y tendencias del desarrollo sostenible en las Entidades Territoriales Autónomas, 2012–2024. La Paz: Universidad Privada Boliviana, SDSN Bolivia. — License: No open license stated (© Universidad Privada Boliviana); used and shared with the permission of SDSN Bolivia
  • SDSN Bolivia (2025). Límites Municipales Bolivia 2025 [Shapefile], with the population of the 2012 and 2024 Population and Housing Censuses (INE). https://sdsnbolivia.org/datos-espaciales/ — License: No open license stated (© Universidad Privada Boliviana); used and shared with the permission of SDSN Bolivia

Cite as

GeoDevelopment Observatory of Bolivia (2026). Sustainable Development Index (IDS), from the Atlas de los ODS en Bolivia 2026 (343 municipalities, ~2012 and ~2024). https://github.com/quarcs-lab/gdo4bolivia/blob/main/docs/datasets/sdg.md

Notes

  • Both periods are stored at nominal years: 2012 for the Atlas's initial values (~2012) and 2024 for its final values (~2024). Each indicator's actual reference years differ (e.g. 2008 and 2023 for the health survey, three-year averages for volatile indicators) and are given in its description and in `geo:reference_years`.
  • Load one variable in both periods, e.g. `geo.load("sdg", variables="index_sdg", names=True)`, and its change per unit with `geo.change(df, "index_sdg")`.
  • The units are the 343 municipalities and indigenous autonomies (GAIOC) of 2025. Four of them were created after the 2012 census (TIOC-Raqaypampa, San Pedro de Macha, TIOC-Jatun Ayllu Yura and TIOC-Territorio Indígena Multiétnico); the Atlas gives them values in both periods.
  • `population` sums; the IDS and `urbanization` aggregate as census-population-weighted means (`geo.aggregate(geo.load("sdg"), to="department", dataset="sdg")`), approximations rather than the Atlas's own department figures; the ranking is not additive (`none`).
  • The goal indices and the 81 indicators are in the goal datasets `sdg01` ... `sdg17` (no 12 or 14).

Notebooks

  • One question, three packages: did Bolivia's municipalities converge?
  • Find, load and understand Bolivia's subnational data with geo4bolivia
  • Dynamics of sustainable development in Bolivia, 2012–2024
  • Exploratory data analysis of multidimensional poverty
  • Spatial inequality of poverty and night-time lights
  • Poverty in Bolivia: an extended EDA and ESDA

Documentation

NoteTwo periods, stored as 2012 and 2024

The SDG Atlas 2026 describes two periods, “around 2012” and “around 2024”. Each indicator’s actual years are in the metadata: geo.reference_years("sdg03") lists them, and geo.cite("sdg") gives the citation and the credits its sources require.

2. Load it

geo.load() returns a panel: one row per unit (geo_id) and year. groups= adds the name of the department each municipality lies in.

ids = geo.load("sdg", variables="index_sdg", groups=["department"])
ids.head()
geo_id name year department index_sdg
0 BO-01-01-01 Azurduy 2012 Chuquisaca 40.8
1 BO-01-01-01 Azurduy 2024 Chuquisaca 54.5
2 BO-01-01-02 Tarvita 2012 Chuquisaca 44.5
3 BO-01-01-02 Tarvita 2024 Chuquisaca 53.9
4 BO-01-02-01 Villa Serrano 2012 Chuquisaca 53.6

Every unit has one geo ID that nests by prefix: BO-04 is the department of La Paz, BO-04-17 its province Murillo and BO-04-17-04 the municipality of Nuestra Señora de La Paz. The data model article explains scales and IDs.

Every dataset is also a CSV and a Parquet file you can read with pandas alone:

import pandas as pd

BASE = "https://raw.githubusercontent.com/quarcs-lab/gdo4bolivia/main/"
ids = pd.read_csv(BASE + "data/municipality/sdg.csv")
units = pd.read_csv(BASE + "geo/units.csv")       # names, parents and source codes

3. Look at it

geo.describe() summarises each variable in each year, with its label and unit:

geo.describe(ids)
variable label unit year count mean std min p25 median p75 max
0 index_sdg Sustainable Development Index, IDS (0-100) index (0-100) 2012 343 50.123032 5.819148 37.2 45.95 49.6 53.35 70.5
1 index_sdg Sustainable Development Index, IDS (0-100) index (0-100) 2024 343 60.081341 5.263740 47.3 56.40 59.8 63.70 77.3

geo.map() draws any variable. With a classification scheme and a list of years, it puts the two periods side by side in the same classes, so the colours are comparable:

geo.map(ids, "index_sdg", year=[2012, 2024], scheme="fisher_jenks")

geo.change() gives one row per municipality with its value, change and rank in both years:

chg = geo.change(ids, "index_sdg")
chg[["name", "department", "index_sdg_2012", "index_sdg_2024", "index_sdg_change"]].nlargest(5, "index_sdg_change")
name department index_sdg_2012 index_sdg_2024 index_sdg_change
194 Cruz de Machacamarca Oruro 42.9 63.4 20.5
199 Carangas Oruro 43.4 62.8 19.4
42 Sicaya Cochabamba 42.8 60.4 17.6
67 Villa Gualberto Villarroel Cochabamba 43.4 60.3 16.9
201 Todos Santos Oruro 44.4 61.2 16.8

4. Analyse it

Every analysis is one call. It takes the panel (or just the dataset id), finds the boundaries and builds the spatial weights itself, and returns a result object.

Is sustainable development clustered in space? Global Moran’s I answers for the whole country:

res = geo.moran(ids, "index_sdg", year=2024)
res

Global Moran’s I for Sustainable Development Index, IDS (0-100) in 2024 is 0.468, against an expectation of -0.00292 under spatial randomness — statistically significant at the 1% level (pseudo p = 0.001 from 999 permutations, under queen contiguity (1 island(s) attached to nearest neighbor), row-standardized, n=343).

The dependence is positive: similar values cluster in space — high values sit next to high values and low next to low, so the map shows contiguous patches rather than a random scatter.

261 of 343 units (76%) fall in the clustering quadrants of the scatter (High-High or Low-Low); the rest are surrounded by neighbors unlike themselves. The slope of the fitted line equals Moran’s I under row-standardized weights, so a steeper line means stronger clustering.

These are associations, not causal effects. A causal reading needs a research design.

Displaying a result shows its main figure and a reading of the numbers. The parts are there to use one by one:

Attribute What it holds
res.fig the main figure (Plotly, interactive); some results have more, e.g. fig_map
res.df the table behind it, one row per unit or year, with geo_id and name
res.gt a formatted table, where one helps (regressions, summaries)
res.moran_i, res.p_sim, … the numbers, by name
res.interpret() the reading in words; it describes associations, never causes
res.notes what the function decided for you (units left out, weights used)
print(round(res.moran_i, 3), res.p_sim, "|", res.w_spec)
0.468 0.001 | queen contiguity (1 island(s) attached to nearest neighbor), row-standardized, n=343

Where are the clusters? Local Moran statistics (LISA) show them on the Moran scatterplot and on the map, side by side:

geo.lisa(ids, "index_sdg", year=2024).fig

And did the municipalities that started lower catch up? β-convergence compares growth with the initial level:

conv = geo.beta_convergence(ids, "index_sdg")
conv

Across 343 units, the growth of Sustainable Development Index, IDS (0-100) over a 12-year window is associated with its initial log level with a total slope of -0.0287 (SE 0.00171), statistically significant at the 1% level. The slope is negative — the β-convergence pattern: units that started lower tended to grow faster, narrowing initial gaps. That slope implies a convergence speed of λ = 0.0351 per year and a half-life of about 19.7 years — the time for half of an initial gap to close at this pace.

These are associations, not causal effects. A causal reading needs a research design.

5. Your own choices, your own data

The defaults are a starting point. Build other weights with geo.weights() and pass them as w=:

w6 = geo.weights("municipality", method="knn", k=6)      # the six nearest municipalities
round(geo.moran(ids, "index_sdg", w=w6).moran_i, 3)
0.45

The functions are not tied to the observatory’s data. Any table with a geo_id column works, and gdf= supplies boundaries for units the package does not know. To bring a table of your own onto the observatory’s units, see Building your own indicators.

Where next

  • Explore: distributions, correlations, trends and maps, before any model.
  • Analyze: spatial dependence, convergence, transitions, inequality, regression and MGWR.
  • Articles: one article per method, and a full case study.
  • Function reference: every function, with an example you can paste into Colab.