====== Brazilian population pyramids ====== January 28, 2015 ===== Locating the data source ===== The main source of data on Brazil is the [[http://www.ibge.gov.br/|Brazilian Institute of Geography and Statistics]] (IBGE). The population pyramids data are likely contained in the results of [[http://www.ibge.gov.br/english/estatistica/populacao/censo2010/default.shtm|Census 2010]] and/or [[http://www.ibge.gov.br/english/estatistica/populacao/censo2000/default.shtm|Census 2000]]. We would like to get the pyramids at the level of [[http://en.wikipedia.org/wiki/Municipalities_of_Brazil|municipalities]]. Currently there are 5570 municipalities. After some searching we get to the pages about the population characteristics of municipalities inside selected regions. Here is the page for the region of Sao Paulo [[http://www.cidades.ibge.gov.br/xtras/temas.php?lang=&codmun=355030&idtema=90&search=sao-paulo|sao-paulo|censo-demografico-2010:-resultados-da-amostra-caracteristicas-da-populacao-]] and here for its municipality Alambari [[http://www.cidades.ibge.gov.br/xtras/temas.php?lang=&codmun=350075&idtema=90&search=sao-paulo|alambari|censo-demografico-2010:-resultados-da-amostra-caracteristicas-da-populacao-]]. We were not able to find a way to download the complete data set or at least the data set for a region. Here are the URLs for displaying data on selected municipality (broken into two lines) and for downloading the corresponding CSV file. http://www.cidades.ibge.gov.br/xtras/temas.php?lang=&codmun=350010&idtema=90&search= sao-paulo|adamantina|censo-demografico-2010:-resultados-da-amostra-caracteristicas-da-populacao- http://www.cidades.ibge.gov.br/xtras/csv.php?lang=&idtema=90&codmun=350010 To download the data about all municipalities we need their ''codmun'' numbers. ===== Downloading ===== Inspecting the region's page source http://www.cidades.ibge.gov.br/xtras/uf.php?lang=&coduf=12&search=acre (example for AC) for different regions AC, AL, ..., SP, TO we notice that the line 220 following the line ''