Skip to content

pycensus.census.countries.mexico.inegi_movilidad.loader

INEGI Censo de Poblacion y Vivienda 2020, Cuestionario Ampliado, "Movilidad cotidiana" tabulado 22: workers by means of transport to work, per municipality (the finest level INEGI publishes the question at; the sample design does not support AGEB estimates).

One workbook per state (cpv2020_a_<abbr>_10_movilidad_cotidiana.xlsx), downloaded once into <cache>/mexico/inegi_movilidad/. Several means may be reported per person, so the published percentages add to more than 100 %; counts here are commuters x percentage (persons using the mode).

from pycensus.census.countries.mexico import inegi_movilidad
inegi_movilidad.state_table("14")          # DataFrame: GEOID (5 digits), name, counts
inegi_movilidad.load(aoi=aoi)              # + municipality geometry (INEGI Marco Geoestadistico)

state_table(state, cache_dir=None)

Municipal rows of tabulado 22 (sex = Total, estimator = Valor) for one state, as counts.

Parameters:

Name Type Description Default
state str

State name, abbreviation or code.

required
cache_dir Optional[str]

Cache folder; None = the pycensus cache.

None

Returns:

Type Description
DataFrame

One row per municipality.

national(states=None, cache_dir=None)

Municipal mode-to-work counts of several states (all by default).

Parameters:

Name Type Description Default
states Optional[List[str]]

State codes; None = all.

None
cache_dir Optional[str]

Cache folder; None = the pycensus cache.

None

Returns:

Type Description
DataFrame

One row per municipality.

load(aoi=None, states=None, level='municipality', cache_dir=None, data_dir=None, **_)

Municipal counts with INEGI municipality geometry, for the states of aoi (or states).

Parameters:

Name Type Description Default
aoi Optional[GeoDataFrame]

Area of interest (GeoDataFrame).

None
states Optional[List[str]]

State codes (instead of aoi).

None
level str

Only "municipality".

'municipality'
cache_dir Optional[str]

Cache folder; None = the pycensus cache.

None
data_dir Optional[str]

Folder of the raw downloads; None = the pycensus cache.

None
**_

Ignored.

{}

Raises:

Type Description
NotImplementedError

For another level.

ValueError

Without aoi or states.