esterday (January 25, 2021) the data from the Census of Population and Housing 2020 of Mexico were published by INEGI (The National Statistical Office of Mexico), that data are free and open. The previous means that you can even make commercial use of said data, as indicated in its policies published in the official gazette.

The level of detail with which these data were published is at city block level when the confidentiality rules allow it, it is possible to know the total population who inhabit that block, or the number of households that have electricity, piped water, or drainage. It is also possible to find out how many households have a video-on-demand service or a video game console. In total, there are 220 variables for each city block in the country. Details of the variables published yesterday can be found on the official INEGI website.

A relevant aspect is that the geographical data of the blocks are also published at the national level, that is, a polygon is published for each city block in the country. These georeferenced polygons are grouped in a shapefile file for each state of the Mexican Republic (32 Shapefiles).

Zoom over some Aguascalientes city blocks.

As you can see in the figure, there is a field called CVEGEO. Which is a unique code for each city block throughout the country and that is useful to join that data with the statistical data tables.

The statistical data tables are found at

By clicking on the first CSV icon you can download all the statistical data for the State of Aguascalienes.

It is possible to join the geographic data with the statistical data using a concatenation of the ENTIDAD + MUN + LOC + AGEB + MZA fields. Which reconstructs the CVEGEO field, from the data available in the CSV file.

Concatenation of ENTIDAD + MUN + LOC + AGEB + MZA fields.

Resulting in georeferenced statistical data. As you can see in the image, the selected city block has 198 inhabitants:

Geographic layer with statistical data resulting from the data join.

I hope it will be useful to you, in future articles I will use these basic principles to integrate a National Database.

Thanks for reading me.

Abel Coronado

Father-Husband-Data Scientist-Philosopher-Entrepreneur-Professor PhD c. in Data Science-MSc Stats #R #Scala #Spark #SatelliteImagery #Python #BigData #Nerd

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store