units

units(scale=None, ref=None)

All units (or the units of one scale) with names, parents and source keys.

Parameters

Name Type Description Default
scale str | None A scale id (see geo.scales()); default: every scale None

Returns

Name Type Description
pandas.DataFrame Every row has geo_id, scale, name, parent_id, area_km2, a <scale>_id column for each coarser scale it lies in, and the codes each source uses for it (e.g. ine_code), which geo.link(..., key=...) matches.

Example

!pip install -q geo4bolivia
import geo4bolivia as geo
import plotly.express as px

m = geo.units("municipality")              # names, parents, INE codes, areas
display(m[["geo_id", "name", "ine_code", "province_id", "department_id"]].head())
px.histogram(m, x="area_km2", log_y=True, title="Municipal areas (km²)")
geo_id name ine_code province_id department_id
0 BO-01-01-01 Azurduy 010201 BO-01-01 BO-01
1 BO-01-01-02 Tarvita 010202 BO-01-01 BO-01
2 BO-01-02-01 Villa Serrano 010801 BO-01-02 BO-01
3 BO-01-03-01 Huacareta 010502 BO-01-03 BO-01
4 BO-01-03-02 Monteagudo 010501 BO-01-03 BO-01