Skip to content

Commit

Permalink
docs(ibge): include pop and censo ibge documentation (#197)
Browse files Browse the repository at this point in the history
* docs(ibge): include pop and censo ibge documentation

* Include total cases by 100k hab on SINAN example

* include documentation for utilities
  • Loading branch information
luabida committed Jul 15, 2024
1 parent fa5429c commit e5c471b
Show file tree
Hide file tree
Showing 6 changed files with 2,279 additions and 1,204 deletions.
2 changes: 1 addition & 1 deletion docs/source/databases/SINAN.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.8"
},
"vscode": {
"interpreter": {
Expand Down
156 changes: 156 additions & 0 deletions docs/source/databases/Utilities.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "c153a255-ad53-4b27-b689-4c119ea8cc52",
"metadata": {},
"source": [
"## Utilities module\n",
"\n",
"Some helper functions that are used throughout the package: "
]
},
{
"cell_type": "markdown",
"id": "c5c639e6-fa54-482a-a91d-20a8bbe05206",
"metadata": {},
"source": [
"### brasil"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "451830fc-04af-4003-8e70-c71d61a57ac5",
"metadata": {},
"outputs": [],
"source": [
"from pysus.utilities import brasil"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "76a37da8-7b41-4565-83e2-e23bfbeae5bb",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'BR': 'Brasil',\n",
" 'AC': 'Acre',\n",
" 'AL': 'Alagoas',\n",
" 'AP': 'Amapá',\n",
" 'AM': 'Amazonas',\n",
" 'BA': 'Bahia',\n",
" 'CE': 'Ceará',\n",
" 'ES': 'Espírito Santo',\n",
" 'GO': 'Goiás',\n",
" 'MA': 'Maranhão',\n",
" 'MT': 'Mato Grosso',\n",
" 'MS': 'Mato Grosso do Sul',\n",
" 'MG': 'Minas Gerais',\n",
" 'PA': 'Pará',\n",
" 'PB': 'Paraíba',\n",
" 'PR': 'Paraná',\n",
" 'PE': 'Pernambuco',\n",
" 'PI': 'Piauí',\n",
" 'RJ': 'Rio de Janeiro',\n",
" 'RN': 'Rio Grande do Norte',\n",
" 'RS': 'Rio Grande do Sul',\n",
" 'RO': 'Rondônia',\n",
" 'RR': 'Roraima',\n",
" 'SC': 'Santa Catarina',\n",
" 'SP': 'São Paulo',\n",
" 'SE': 'Sergipe',\n",
" 'TO': 'Tocantins',\n",
" 'DF': 'Distrito Federal'}"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"brasil.UFs"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "965a2323-066c-45af-83f7-b20ece735089",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{1: 'Janeiro',\n",
" 2: 'Fevereiro',\n",
" 3: 'Março',\n",
" 4: 'Abril',\n",
" 5: 'Maio',\n",
" 6: 'Junho',\n",
" 7: 'Julho',\n",
" 8: 'Agosto',\n",
" 9: 'Setembro',\n",
" 10: 'Outubro',\n",
" 11: 'Novembro',\n",
" 12: 'Dezembro'}"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"brasil.MONTHS"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "573f2f20-f038-4384-b6f2-558bad80f276",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'Rio de Janeiro'"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Get municipality name by IBGE's geocode \n",
"# https://www.ibge.gov.br/explica/codigos-dos-municipios.php\n",
"brasil.get_city_name_by_geocode(3304557)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading

0 comments on commit e5c471b

Please sign in to comment.