From 3b7ce9a922ec297853f34b60cb6cfeff3084ca66 Mon Sep 17 00:00:00 2001 From: vilelaluiza Date: Fri, 18 Oct 2024 15:18:47 -0300 Subject: [PATCH] =?UTF-8?q?cria=20conjunto=20br=5Finep=5Feducacao=5Fespeci?= =?UTF-8?q?al=20com=20pedidos=20LAI=20+=20tabelas=20da=20Sinopse=20sobre?= =?UTF-8?q?=20educa=C3=A7=C3=A3o=20especial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbt_project.yml | 3 + ...ucacao_especial__distorcao_idade_serie.sql | 14 + ...br_inep_educacao_especial__docente_aee.sql | 21 + ...ep_educacao_especial__docente_formacao.sql | 18 + ..._inep_educacao_especial__etapa_ensino.sql} | 8 +- ..._inep_educacao_especial__faixa_etaria.sql} | 8 +- ...r_inep_educacao_especial__localizacao.sql} | 8 +- ..._inep_educacao_especial__matricula_aee.sql | 16 + ...inep_educacao_especial__sexo_raca_cor.sql} | 8 +- ...nep_educacao_especial__taxa_rendimento.sql | 16 + ..._inep_educacao_especial__tempo_ensino.sql} | 8 +- ...p_educacao_especial__tipo_deficiencia.sql} | 8 +- .../code/educacao_especial_aee_docente.ipynb | 630 +++ .../educacao_especial_aee_matricula.ipynb | 458 ++ ...cacao_especial_distorcao_idade_serie.ipynb | 4066 +++++++++++++++++ .../educacao_especial_formacao_docente.ipynb | 460 ++ .../educacao_especial_taxa_rendimento.ipynb | 815 ++++ models/br_inep_educacao_especial/schema.yml | 339 ++ .../schema.yml | 201 - 19 files changed, 6874 insertions(+), 231 deletions(-) create mode 100644 models/br_inep_educacao_especial/br_inep_educacao_especial__distorcao_idade_serie.sql create mode 100644 models/br_inep_educacao_especial/br_inep_educacao_especial__docente_aee.sql create mode 100644 models/br_inep_educacao_especial/br_inep_educacao_especial__docente_formacao.sql rename models/{br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_etapa_ensino.sql => br_inep_educacao_especial/br_inep_educacao_especial__etapa_ensino.sql} (75%) rename models/{br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_faixa_etaria.sql => br_inep_educacao_especial/br_inep_educacao_especial__faixa_etaria.sql} (70%) rename models/{br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_localizacao.sql => br_inep_educacao_especial/br_inep_educacao_especial__localizacao.sql} (71%) create mode 100644 models/br_inep_educacao_especial/br_inep_educacao_especial__matricula_aee.sql rename models/{br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_sexo_raca_cor.sql => br_inep_educacao_especial/br_inep_educacao_especial__sexo_raca_cor.sql} (73%) create mode 100644 models/br_inep_educacao_especial/br_inep_educacao_especial__taxa_rendimento.sql rename models/{br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_tempo_ensino.sql => br_inep_educacao_especial/br_inep_educacao_especial__tempo_ensino.sql} (71%) rename models/{br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_tipo_deficiencia.sql => br_inep_educacao_especial/br_inep_educacao_especial__tipo_deficiencia.sql} (75%) create mode 100644 models/br_inep_educacao_especial/code/educacao_especial_aee_docente.ipynb create mode 100644 models/br_inep_educacao_especial/code/educacao_especial_aee_matricula.ipynb create mode 100644 models/br_inep_educacao_especial/code/educacao_especial_distorcao_idade_serie.ipynb create mode 100644 models/br_inep_educacao_especial/code/educacao_especial_formacao_docente.ipynb create mode 100644 models/br_inep_educacao_especial/code/educacao_especial_taxa_rendimento.ipynb create mode 100644 models/br_inep_educacao_especial/schema.yml diff --git a/dbt_project.yml b/dbt_project.yml index d7937d94..97933eb0 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -204,6 +204,9 @@ models: br_inep_censo_escolar: +materialized: table +schema: br_inep_censo_escolar + br_inep_educacao_especial: + +materialized: table + +schema: br_inep_educacao_especial br_inep_enem: +materialized: table +schema: br_inep_enem diff --git a/models/br_inep_educacao_especial/br_inep_educacao_especial__distorcao_idade_serie.sql b/models/br_inep_educacao_especial/br_inep_educacao_especial__distorcao_idade_serie.sql new file mode 100644 index 00000000..c4843e18 --- /dev/null +++ b/models/br_inep_educacao_especial/br_inep_educacao_especial__distorcao_idade_serie.sql @@ -0,0 +1,14 @@ +{{ + config( + alias="distorcao_idade_serie", + schema="br_inep_educacao_especial", + materialized="table", + ) +}} + +select + safe_cast(ano as int64) ano, + safe_cast(sigla_uf as string) sigla_uf, + safe_cast(etapa_ensino as string) etapa_ensino, + safe_cast(tdi as numeric) tdi, +from `basedosdados-staging.br_inep_educacao_especial_staging.distorcao_idade_serie` as t diff --git a/models/br_inep_educacao_especial/br_inep_educacao_especial__docente_aee.sql b/models/br_inep_educacao_especial/br_inep_educacao_especial__docente_aee.sql new file mode 100644 index 00000000..0fa2f225 --- /dev/null +++ b/models/br_inep_educacao_especial/br_inep_educacao_especial__docente_aee.sql @@ -0,0 +1,21 @@ +{{ + config( + alias="docente_aee", + schema="br_inep_educacao_especial", + materialized="table", + ) +}} + +select + safe_cast(ano as int64) ano, + safe_cast(sigla_uf as string) sigla_uf, + safe_cast(id_municipio as string) id_municipio, + safe_cast(quantidade_docente_regente as int64) quantidade_docente_regente, + safe_cast(quantidade_docente_aee as int64) quantidade_docente_aee, + safe_cast( + quantidade_docente_regente_formacao_continuada as int64 + ) quantidade_docente_regente_formacao_continuada, + safe_cast( + quantidade_docente_aee_formacao_continuada as int64 + ) quantidade_docente_aee_formacao_continuada, +from `basedosdados-staging.br_inep_educacao_especial_staging.docente_aee` as t diff --git a/models/br_inep_educacao_especial/br_inep_educacao_especial__docente_formacao.sql b/models/br_inep_educacao_especial/br_inep_educacao_especial__docente_formacao.sql new file mode 100644 index 00000000..2dca248e --- /dev/null +++ b/models/br_inep_educacao_especial/br_inep_educacao_especial__docente_formacao.sql @@ -0,0 +1,18 @@ +{{ + config( + alias="docente_formacao", + schema="br_inep_educacao_especial", + materialized="table", + ) +}} + +select + safe_cast(ano as int64) ano, + safe_cast(sigla_uf as string) sigla_uf, + safe_cast(id_municipio as string) id_municipio, + safe_cast(rede as string) rede, + safe_cast( + quantidade_docente_formacao_continuada as int64 + ) quantidade_docente_formacao_continuada, + +from `basedosdados-staging.br_inep_educacao_especial_staging.docente_formacao` as t diff --git a/models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_etapa_ensino.sql b/models/br_inep_educacao_especial/br_inep_educacao_especial__etapa_ensino.sql similarity index 75% rename from models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_etapa_ensino.sql rename to models/br_inep_educacao_especial/br_inep_educacao_especial__etapa_ensino.sql index 09c49394..2acac0d8 100644 --- a/models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_etapa_ensino.sql +++ b/models/br_inep_educacao_especial/br_inep_educacao_especial__etapa_ensino.sql @@ -1,7 +1,7 @@ {{ config( - alias="educacao_especial_etapa_ensino", - schema="br_inep_sinopse_estatistica_educacao_basica", + alias="etapa_ensino", + schema="br_inep_educacao_especial", materialized="table", partition_by={ "field": "ano", @@ -24,6 +24,4 @@ select end as string ) etapa_ensino, safe_cast(quantidade_matricula as numeric) quantidade_matricula -from - `basedosdados-staging.br_inep_sinopse_estatistica_educacao_basica_staging.educacao_especial_etapa_ensino` - as t +from `basedosdados-staging.br_inep_educacao_especial_staging.etapa_ensino` as t diff --git a/models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_faixa_etaria.sql b/models/br_inep_educacao_especial/br_inep_educacao_especial__faixa_etaria.sql similarity index 70% rename from models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_faixa_etaria.sql rename to models/br_inep_educacao_especial/br_inep_educacao_especial__faixa_etaria.sql index a101d605..f4073d74 100644 --- a/models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_faixa_etaria.sql +++ b/models/br_inep_educacao_especial/br_inep_educacao_especial__faixa_etaria.sql @@ -1,7 +1,7 @@ {{ config( - alias="educacao_especial_faixa_etaria", - schema="br_inep_sinopse_estatistica_educacao_basica", + alias="faixa_etaria", + schema="br_inep_educacao_especial", materialized="table", partition_by={ "field": "ano", @@ -18,6 +18,4 @@ select safe_cast(tipo_classe as string) tipo_classe, safe_cast(faixa_etaria as string) faixa_etaria, safe_cast(quantidade_matricula as numeric) quantidade_matricula, -from - `basedosdados-staging.br_inep_sinopse_estatistica_educacao_basica_staging.educacao_especial_faixa_etaria` - as t +from `basedosdados-staging.br_inep_educacao_especial_staging.faixa_etaria` as t diff --git a/models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_localizacao.sql b/models/br_inep_educacao_especial/br_inep_educacao_especial__localizacao.sql similarity index 71% rename from models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_localizacao.sql rename to models/br_inep_educacao_especial/br_inep_educacao_especial__localizacao.sql index b5619396..cf12893a 100644 --- a/models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_localizacao.sql +++ b/models/br_inep_educacao_especial/br_inep_educacao_especial__localizacao.sql @@ -1,7 +1,7 @@ {{ config( - alias="educacao_especial_localizacao", - schema="br_inep_sinopse_estatistica_educacao_basica", + alias="localizacao", + schema="br_inep_educacao_especial", materialized="table", partition_by={ "field": "ano", @@ -19,6 +19,4 @@ select safe_cast(rede as string) rede, safe_cast(localizacao as string) localizacao, safe_cast(quantidade_matricula as numeric) quantidade_matricula, -from - `basedosdados-staging.br_inep_sinopse_estatistica_educacao_basica_staging.educacao_especial_localizacao` - as t +from `basedosdados-staging.br_inep_educacao_especial_staging.localizacao` as t diff --git a/models/br_inep_educacao_especial/br_inep_educacao_especial__matricula_aee.sql b/models/br_inep_educacao_especial/br_inep_educacao_especial__matricula_aee.sql new file mode 100644 index 00000000..174da9a4 --- /dev/null +++ b/models/br_inep_educacao_especial/br_inep_educacao_especial__matricula_aee.sql @@ -0,0 +1,16 @@ +{{ + config( + alias="matricula_aee", + schema="br_inep_educacao_especial", + materialized="table", + ) +}} + +select + safe_cast(ano as int64) ano, + safe_cast(sigla_uf as string) sigla_uf, + safe_cast(rede as string) rede, + safe_cast(quantidade_matricula as int64) quantidade_matricula, + safe_cast(quantidade_matricula_aee as int64) quantidade_matricula_aee, + +from `basedosdados-staging.br_inep_educacao_especial_staging.matricula_aee` as t diff --git a/models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_sexo_raca_cor.sql b/models/br_inep_educacao_especial/br_inep_educacao_especial__sexo_raca_cor.sql similarity index 73% rename from models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_sexo_raca_cor.sql rename to models/br_inep_educacao_especial/br_inep_educacao_especial__sexo_raca_cor.sql index 96b61508..c9e3b242 100644 --- a/models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_sexo_raca_cor.sql +++ b/models/br_inep_educacao_especial/br_inep_educacao_especial__sexo_raca_cor.sql @@ -1,7 +1,7 @@ {{ config( - alias="educacao_especial_sexo_raca_cor", - schema="br_inep_sinopse_estatistica_educacao_basica", + alias="sexo_raca_cor", + schema="br_inep_educacao_especial", materialized="table", partition_by={ "field": "ano", @@ -21,6 +21,4 @@ select case when raca_cor = 'Fmarela' then 'Amarela' else raca_cor end as string ) raca_cor, safe_cast(quantidade_matricula as numeric) quantidade_matricula, -from - `basedosdados-staging.br_inep_sinopse_estatistica_educacao_basica_staging.educacao_especial_sexo_raca_cor` - as t +from `basedosdados-staging.br_inep_educacao_especial_staging.sexo_raca_cor` as t diff --git a/models/br_inep_educacao_especial/br_inep_educacao_especial__taxa_rendimento.sql b/models/br_inep_educacao_especial/br_inep_educacao_especial__taxa_rendimento.sql new file mode 100644 index 00000000..270136ab --- /dev/null +++ b/models/br_inep_educacao_especial/br_inep_educacao_especial__taxa_rendimento.sql @@ -0,0 +1,16 @@ +{{ + config( + alias="taxa_rendimento", + schema="br_inep_educacao_especial", + materialized="table", + ) +}} + +select + safe_cast(ano as int64) ano, + safe_cast(sigla_uf as string) sigla_uf, + safe_cast(etapa_ensino as string) etapa_ensino, + safe_cast(taxa_aprovacao as numeric) taxa_aprovacao, + safe_cast(taxa_reprovacao as numeric) taxa_reprovacao, + safe_cast(taxa_abandono as numeric) taxa_abandono, +from `basedosdados-staging.br_inep_educacao_especial_staging.taxa_rendimento` as t diff --git a/models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_tempo_ensino.sql b/models/br_inep_educacao_especial/br_inep_educacao_especial__tempo_ensino.sql similarity index 71% rename from models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_tempo_ensino.sql rename to models/br_inep_educacao_especial/br_inep_educacao_especial__tempo_ensino.sql index 8de1398b..17158c1b 100644 --- a/models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_tempo_ensino.sql +++ b/models/br_inep_educacao_especial/br_inep_educacao_especial__tempo_ensino.sql @@ -1,7 +1,7 @@ {{ config( - alias="educacao_especial_tempo_ensino", - schema="br_inep_sinopse_estatistica_educacao_basica", + alias="tempo_ensino", + schema="br_inep_educacao_especial", materialized="table", partition_by={ "field": "ano", @@ -19,6 +19,4 @@ select safe_cast(rede as string) rede, safe_cast(tempo_ensino as string) tempo_ensino, safe_cast(quantidade_matricula as numeric) quantidade_matricula, -from - `basedosdados-staging.br_inep_sinopse_estatistica_educacao_basica_staging.educacao_especial_tempo_ensino` - as t +from `basedosdados-staging.br_inep_educacao_especial_staging.tempo_ensino` as t diff --git a/models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_tipo_deficiencia.sql b/models/br_inep_educacao_especial/br_inep_educacao_especial__tipo_deficiencia.sql similarity index 75% rename from models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_tipo_deficiencia.sql rename to models/br_inep_educacao_especial/br_inep_educacao_especial__tipo_deficiencia.sql index 988decef..a98caf1a 100644 --- a/models/br_inep_sinopse_estatistica_educacao_basica/br_inep_sinopse_estatistica_educacao_basica__educacao_especial_tipo_deficiencia.sql +++ b/models/br_inep_educacao_especial/br_inep_educacao_especial__tipo_deficiencia.sql @@ -1,7 +1,7 @@ {{ config( - alias="educacao_especial_tipo_deficiencia", - schema="br_inep_sinopse_estatistica_educacao_basica", + alias="tipo_deficiencia", + schema="br_inep_educacao_especial", materialized="table", partition_by={ "field": "ano", @@ -24,6 +24,4 @@ select end as string ) tipo_deficiencia, safe_cast(quantidade_matricula as numeric) quantidade_matricula, -from - `basedosdados-staging.br_inep_sinopse_estatistica_educacao_basica_staging.educacao_especial_tipo_deficiencia` - as t +from `basedosdados-staging.br_inep_educacao_especial_staging.tipo_deficiencia` as t diff --git a/models/br_inep_educacao_especial/code/educacao_especial_aee_docente.ipynb b/models/br_inep_educacao_especial/code/educacao_especial_aee_docente.ipynb new file mode 100644 index 00000000..a25c0d30 --- /dev/null +++ b/models/br_inep_educacao_especial/code/educacao_especial_aee_docente.ipynb @@ -0,0 +1,630 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import zipfile\n", + "import pandas as pd\n", + "import basedosdados as bd\n", + "\n", + "INPUT = os.path.join(os.getcwd(), \"input\")\n", + "OUTPUT = os.path.join(os.getcwd(), \"output\")\n", + "\n", + "os.makedirs(INPUT, exist_ok=True)\n", + "os.makedirs(OUTPUT, exist_ok=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "def read_sheet(sheet_name: str, skiprows: int = 2) -> pd.DataFrame:\n", + " return pd.read_excel(\n", + " os.path.join(\n", + " INPUT,\n", + " \"2020_2022_INDIC_ED_ESP.xlsx\"\n", + " ),\n", + " skiprows=skiprows,\n", + " sheet_name=sheet_name,\n", + " dtype=str\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "sheets_etapa_ensino_serie = {\n", + " \"INDICADOR 2\":\"regente_aee\",\n", + " \"INDICADOR 3\":\"aee\",\n", + " \"INDICADOR 4\":\"regente_formacaocontinuada\",\n", + " \"INDICADOR 5\":\"aee_formacaocontinuada\", \n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "dfs = {\n", + " name: read_sheet(sheet_name)\n", + " for sheet_name, name in sheets_etapa_ensino_serie.items()\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "dataframes = {}\n", + "\n", + "for table_name, columns in dfs.items():\n", + " df = pd.DataFrame(columns) # Create DataFrame for each table\n", + " dataframes[table_name] = df # Store the DataFrame in a dictionary" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Index(['NU_ANO_CENSO', 'CO_REGIAO', 'NO_REGIAO', 'CO_UF', 'NO_UF', 'SIGLA',\n", + " 'NO_MUNICIPIO', 'CO_MUNICIPIO', 'DOCENTES'],\n", + " dtype='object')" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dataframes['aee'].columns" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "RENAMES_COLUMNS = {\n", + " \"regente_aee\": {\n", + " 'NU_ANO_CENSO':'ano', \n", + " #'CO_REGIAO',\n", + " #'NO_REGIAO', \n", + " #'CO_UF', \n", + " #'NO_UF', \n", + " 'SIGLA':\"sigla_uf\",\n", + " #'NO_MUNICIPIO', \n", + " 'CO_MUNICIPIO':\"id_municipio\", \n", + " 'DOCENTES':'quantidade_docente_regente_aee'\n", + " },\n", + " \"aee\": {\n", + " 'NU_ANO_CENSO':'ano', \n", + " #'CO_REGIAO',\n", + " #'NO_REGIAO', \n", + " #'CO_UF', \n", + " #'NO_UF', \n", + " 'SIGLA':\"sigla_uf\",\n", + " #'NO_MUNICIPIO', \n", + " 'CO_MUNICIPIO':\"id_municipio\", \n", + " 'DOCENTES':'quantidade_docente_aee'\n", + " },\n", + " \"regente_formacaocontinuada\": {\n", + " 'NU_ANO_CENSO':'ano', \n", + " #'CO_REGIAO',\n", + " #'NO_REGIAO', \n", + " #'CO_UF', \n", + " #'NO_UF', \n", + " 'SIGLA':\"sigla_uf\",\n", + " #'NO_MUNICIPIO', \n", + " 'CO_MUNICIPIO':\"id_municipio\", \n", + " 'DOCENTES':'quantidade_docente_regente_formacao_continuada'\n", + " },\n", + " \"aee_formacaocontinuada\": {\n", + " 'NU_ANO_CENSO':'ano', \n", + " #'CO_REGIAO',\n", + " #'NO_REGIAO', \n", + " #'CO_UF', \n", + " #'NO_UF', \n", + " 'SIGLA':\"sigla_uf\",\n", + " #'NO_MUNICIPIO', \n", + " 'CO_MUNICIPIO':\"id_municipio\", \n", + " 'DOCENTES':'quantidade_docente_aee_formacao_continuada'\n", + " }\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "def drop_unused_columns(df: pd.DataFrame) -> pd.DataFrame:\n", + " cols_drop = [\n", + " col\n", + " for col in df.columns\n", + " if col.startswith(\"CO_\")\n", + " or col.startswith(\"NO_\")\n", + " ]\n", + "\n", + " return df.drop(columns=cols_drop)\n", + "\n", + "dfs = {\n", + " name: drop_unused_columns(\n", + " df.rename(columns=RENAMES_COLUMNS[name], errors=\"raise\")\n", + " )\n", + " for name, df in dfs.items()\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sheet: regente_aee\n", + "Index(['ano', 'sigla_uf', 'id_municipio', 'quantidade_docente_regente_aee'], dtype='object')\n", + "\n", + "Sheet: aee\n", + "Index(['ano', 'sigla_uf', 'id_municipio', 'quantidade_docente_aee'], dtype='object')\n", + "\n", + "Sheet: regente_formacaocontinuada\n", + "Index(['ano', 'sigla_uf', 'id_municipio',\n", + " 'quantidade_docente_regente_formacao_continuada'],\n", + " dtype='object')\n", + "\n", + "Sheet: aee_formacaocontinuada\n", + "Index(['ano', 'sigla_uf', 'id_municipio',\n", + " 'quantidade_docente_aee_formacao_continuada'],\n", + " dtype='object')\n", + "\n" + ] + } + ], + "source": [ + "for sheet_name, df in dfs.items():\n", + " print(f\"Sheet: {sheet_name}\")\n", + " print(df.columns) # This will print the column names of each DataFrame\n", + " print()" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "def remove_nulls(df: pd.DataFrame, name: str) -> pd.DataFrame:\n", + " # Ensure you're working with the whole DataFrame\n", + " df = df.dropna(subset=['id_municipio']) # Remove rows where 'id_municipio' is NaN\n", + " df = df.loc[df['id_municipio'].astype(str) != \" \"] # Filter out rows where 'id_municipio' is empty space\n", + " return df\n", + "\n", + "# Apply remove_nulls to each DataFrame in the dictionary\n", + "dfs = {\n", + " name: remove_nulls(df, name) # This keeps the original key (sheet name) with the cleaned DataFrame\n", + " for name, df in dfs.items()\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'regente_aee': ano sigla_uf id_municipio quantidade_docente_regente_aee\n", + " 3 2020 RO 1100015 291\n", + " 4 2020 RO 1100379 128\n", + " 5 2020 RO 1100403 135\n", + " 6 2020 RO 1100346 189\n", + " 7 2020 RO 1100023 1018\n", + " ... ... ... ... ...\n", + " 16803 2022 GO 5222302 78\n", + " 16804 2022 GO 5200175 58\n", + " 16805 2022 GO 5200209 31\n", + " 16806 2022 GO 5200258 1818\n", + " 16808 2022 DF 5300108 30821\n", + " \n", + " [16710 rows x 4 columns],\n", + " 'aee': ano sigla_uf id_municipio quantidade_docente_aee\n", + " 3 2020 RO 1100015 10\n", + " 4 2020 RO 1100379 3\n", + " 5 2020 RO 1100403 4\n", + " 6 2020 RO 1100346 11\n", + " 7 2020 RO 1100023 55\n", + " ... ... ... ... ...\n", + " 13851 2022 GO 5222203 3\n", + " 13852 2022 GO 5222302 3\n", + " 13853 2022 GO 5200209 2\n", + " 13854 2022 GO 5200258 58\n", + " 13856 2022 DF 5300108 673\n", + " \n", + " [13758 rows x 4 columns],\n", + " 'regente_formacaocontinuada': ano sigla_uf id_municipio \\\n", + " 3 2020 RO 1100015 \n", + " 4 2020 RO 1100379 \n", + " 5 2020 RO 1100403 \n", + " 6 2020 RO 1100346 \n", + " 7 2020 RO 1100023 \n", + " ... ... ... ... \n", + " 15133 2022 GO 5222302 \n", + " 15134 2022 GO 5200175 \n", + " 15135 2022 GO 5200209 \n", + " 15136 2022 GO 5200258 \n", + " 15138 2022 DF 5300108 \n", + " \n", + " quantidade_docente_regente_formacao_continuada \n", + " 3 14 \n", + " 4 1 \n", + " 5 2 \n", + " 6 9 \n", + " 7 34 \n", + " ... ... \n", + " 15133 2 \n", + " 15134 3 \n", + " 15135 6 \n", + " 15136 310 \n", + " 15138 4051 \n", + " \n", + " [15040 rows x 4 columns],\n", + " 'aee_formacaocontinuada': ano sigla_uf id_municipio quantidade_docente_aee_formacao_continuada\n", + " 3 2020 RO 1100015 5\n", + " 4 2020 RO 1100346 1\n", + " 5 2020 RO 1100023 15\n", + " 6 2020 RO 1100452 7\n", + " 7 2020 RO 1100031 3\n", + " ... ... ... ... ...\n", + " 9899 2022 GO 5221858 19\n", + " 9900 2022 GO 5222203 1\n", + " 9901 2022 GO 5200209 1\n", + " 9902 2022 GO 5200258 39\n", + " 9904 2022 DF 5300108 471\n", + " \n", + " [9806 rows x 4 columns]}" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dfs" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "\n", + "# Assuming 'dfs' is your dictionary with four tables\n", + "df_regente_aee = pd.DataFrame(dfs['regente_aee'])\n", + "df_aee = pd.DataFrame(dfs['aee'])\n", + "df_regente_formacaocontinuada = pd.DataFrame(dfs['regente_formacaocontinuada']) # Example third table\n", + "df_aee_formacaocontinuada = pd.DataFrame(dfs['aee_formacaocontinuada']) # Example fourth table\n", + "\n", + "# Merge all four DataFrames with outer join on 'ano', 'sigla_uf', 'id_municipio'\n", + "merged_df = df_regente_aee.merge(df_aee, on=['ano', 'sigla_uf', 'id_municipio'], how='outer')\n", + "merged_df = merged_df.merge(df_regente_formacaocontinuada, on=['ano', 'sigla_uf', 'id_municipio'], how='outer')\n", + "merged_df = merged_df.merge(df_aee_formacaocontinuada, on=['ano', 'sigla_uf', 'id_municipio'], how='outer')\n" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "merged_df['quantidade_docente_regente_aee'] = pd.to_numeric(merged_df['quantidade_docente_regente_aee'], errors='coerce')\n", + "merged_df['quantidade_docente_aee'] = pd.to_numeric(merged_df['quantidade_docente_aee'], errors='coerce')" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "merged_df['quantidade_docente_regente'] = merged_df['quantidade_docente_regente_aee'] - merged_df['quantidade_docente_aee']" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "merged_df = merged_df.drop(columns='quantidade_docente_regente_aee', axis='')" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [], + "source": [ + "merged_df = merged_df[[\n", + " 'ano', \n", + " 'sigla_uf', \n", + " 'id_municipio',\n", + " 'quantidade_docente_regente',\n", + " 'quantidade_docente_aee',\n", + " 'quantidade_docente_regente_formacao_continuada',\n", + " 'quantidade_docente_aee_formacao_continuada']]" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
anosigla_ufid_municipioquantidade_docente_regentequantidade_docente_aeequantidade_docente_regente_formacao_continuadaquantidade_docente_aee_formacao_continuada
02020RO1100015281.010.0145
12020RO1100379125.03.01NaN
22020RO1100403131.04.02NaN
32020RO1100346178.011.091
42020RO1100023963.055.03415
........................
167052022GO522230275.03.02NaN
167062022GO5200175NaNNaN3NaN
167072022GO520020929.02.061
167082022GO52002581760.058.031039
167092022DF530010830148.0673.04051471
\n", + "

16710 rows × 7 columns

\n", + "
" + ], + "text/plain": [ + " ano sigla_uf id_municipio quantidade_docente_regente \\\n", + "0 2020 RO 1100015 281.0 \n", + "1 2020 RO 1100379 125.0 \n", + "2 2020 RO 1100403 131.0 \n", + "3 2020 RO 1100346 178.0 \n", + "4 2020 RO 1100023 963.0 \n", + "... ... ... ... ... \n", + "16705 2022 GO 5222302 75.0 \n", + "16706 2022 GO 5200175 NaN \n", + "16707 2022 GO 5200209 29.0 \n", + "16708 2022 GO 5200258 1760.0 \n", + "16709 2022 DF 5300108 30148.0 \n", + "\n", + " quantidade_docente_aee quantidade_docente_regente_formacao_continuada \\\n", + "0 10.0 14 \n", + "1 3.0 1 \n", + "2 4.0 2 \n", + "3 11.0 9 \n", + "4 55.0 34 \n", + "... ... ... \n", + "16705 3.0 2 \n", + "16706 NaN 3 \n", + "16707 2.0 6 \n", + "16708 58.0 310 \n", + "16709 673.0 4051 \n", + "\n", + " quantidade_docente_aee_formacao_continuada \n", + "0 5 \n", + "1 NaN \n", + "2 NaN \n", + "3 1 \n", + "4 15 \n", + "... ... \n", + "16705 NaN \n", + "16706 NaN \n", + "16707 1 \n", + "16708 39 \n", + "16709 471 \n", + "\n", + "[16710 rows x 7 columns]" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "merged_df" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [], + "source": [ + "path = os.path.join(\n", + " OUTPUT, \"educacao_especial_aee_docente\"\n", + " )\n", + "\n", + "os.makedirs(path, exist_ok=True)\n", + "merged_df.astype(str).to_csv(os.path.join(path, \"data.csv\"), index=False)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.9.17" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/models/br_inep_educacao_especial/code/educacao_especial_aee_matricula.ipynb b/models/br_inep_educacao_especial/code/educacao_especial_aee_matricula.ipynb new file mode 100644 index 00000000..34abfecc --- /dev/null +++ b/models/br_inep_educacao_especial/code/educacao_especial_aee_matricula.ipynb @@ -0,0 +1,458 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import zipfile\n", + "import pandas as pd\n", + "import basedosdados as bd\n", + "\n", + "INPUT = os.path.join(os.getcwd(), \"input\")\n", + "OUTPUT = os.path.join(os.getcwd(), \"output\")\n", + "\n", + "os.makedirs(INPUT, exist_ok=True)\n", + "os.makedirs(OUTPUT, exist_ok=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [], + "source": [ + "def read_sheet(sheet_name: str, skiprows: int = 7) -> pd.DataFrame:\n", + " return pd.read_excel(\n", + " os.path.join(\n", + " INPUT,\n", + " \"mat_ed_especial_aee_uf_rede_2019_2022.xlsx\"\n", + " ),\n", + " skiprows=skiprows,\n", + " sheet_name=sheet_name\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [], + "source": [ + "excel_data = pd.ExcelFile(os.path.join(\n", + " INPUT,\n", + " \"mat_ed_especial_aee_uf_rede_2019_2022.xlsx\"\n", + " ))\n", + "\n", + "# Get the sheet names\n", + "sheet_names = excel_data.sheet_names" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [], + "source": [ + "dfs = {\n", + " sheet_name: read_sheet(sheet_name)\n", + " for sheet_name in sheet_names\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'tabmat': NU_ANO_CENSO NO_REGIAO CO_REGIAO \\\n", + " 0 2022 Brasil NaN \n", + " 1 2022 Brasil NaN \n", + " 2 2022 Brasil NaN \n", + " 3 2022 Norte 1.0 \n", + " 4 2022 Norte 1.0 \n", + " .. ... ... ... \n", + " 333 2019 Centro-Oeste 5.0 \n", + " 334 2019 Centro-Oeste 5.0 \n", + " 335 2019 Centro-Oeste 5.0 \n", + " 336 NaN NaN NaN \n", + " 337 Fonte: Censo Escolar da Educação Básica/Inep. NaN NaN \n", + " \n", + " NO_UF SG_UF CO_UF rede MatEsp MatEspAee \n", + " 0 NaN NaN NaN NaN 1527794.0 568200.0 \n", + " 1 NaN NaN NaN Pública 1301961.0 525868.0 \n", + " 2 NaN NaN NaN Privada 225833.0 42332.0 \n", + " 3 Rondônia RO 11.0 NaN 14341.0 8328.0 \n", + " 4 Rondônia RO 11.0 Pública 12803.0 6965.0 \n", + " .. ... ... ... ... ... ... \n", + " 333 Distrito Federal DF 53.0 NaN 16580.0 8967.0 \n", + " 334 Distrito Federal DF 53.0 Pública 14362.0 8702.0 \n", + " 335 Distrito Federal DF 53.0 Privada 2218.0 265.0 \n", + " 336 NaN NaN NaN NaN NaN NaN \n", + " 337 NaN NaN NaN NaN NaN NaN \n", + " \n", + " [338 rows x 9 columns]}" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dfs" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sheet: tabmat\n", + "Index(['NU_ANO_CENSO', 'NO_REGIAO', 'CO_REGIAO', 'NO_UF', 'SG_UF', 'CO_UF',\n", + " 'rede', 'MatEsp', 'MatEspAee'],\n", + " dtype='object')\n", + "\n" + ] + } + ], + "source": [ + "for sheet_name, df in dfs.items():\n", + " print(f\"Sheet: {sheet_name}\")\n", + " print(df.columns) # This will print the column names of each DataFrame\n", + " print() # Adds a blank line for readability" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [], + "source": [ + "RENAME_COLUMNS = {\n", + " 'NU_ANO_CENSO':'ano',\n", + " 'SG_UF':'sigla_uf', \n", + " 'MatEsp':'quantidade_matricula', \n", + " 'MatEspAee':'quantidade_matricula_aee'}" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [], + "source": [ + "def drop_unused_columns(df: pd.DataFrame) -> pd.DataFrame:\n", + " cols_drop = [\n", + " col\n", + " for col in df.columns\n", + " if col.startswith(\"NO_\") \n", + " or col.startswith(\"CO\") \n", + " ]\n", + "\n", + " return df.drop(columns=cols_drop)\n", + "\n", + "dfs = {\n", + " name: drop_unused_columns(\n", + " df.rename(columns=RENAME_COLUMNS, errors=\"raise\")\n", + " )\n", + " for name, df in dfs.items()\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'tabmat': ano sigla_uf rede \\\n", + " 0 2022 NaN NaN \n", + " 1 2022 NaN Pública \n", + " 2 2022 NaN Privada \n", + " 3 2022 RO NaN \n", + " 4 2022 RO Pública \n", + " .. ... ... ... \n", + " 333 2019 DF NaN \n", + " 334 2019 DF Pública \n", + " 335 2019 DF Privada \n", + " 336 NaN NaN NaN \n", + " 337 Fonte: Censo Escolar da Educação Básica/Inep. NaN NaN \n", + " \n", + " quantidade_matricula quantidade_matricula_aee \n", + " 0 1527794.0 568200.0 \n", + " 1 1301961.0 525868.0 \n", + " 2 225833.0 42332.0 \n", + " 3 14341.0 8328.0 \n", + " 4 12803.0 6965.0 \n", + " .. ... ... \n", + " 333 16580.0 8967.0 \n", + " 334 14362.0 8702.0 \n", + " 335 2218.0 265.0 \n", + " 336 NaN NaN \n", + " 337 NaN NaN \n", + " \n", + " [338 rows x 5 columns]}" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dfs" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sheet: tabmat\n", + "Index(['ano', 'sigla_uf', 'rede', 'quantidade_matricula',\n", + " 'quantidade_matricula_aee'],\n", + " dtype='object')\n", + "\n" + ] + } + ], + "source": [ + "for sheet_name, df in dfs.items():\n", + " print(f\"Sheet: {sheet_name}\")\n", + " print(df.columns) # This will print the column names of each DataFrame\n", + " print() " + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [], + "source": [ + "dataframe = pd.DataFrame(dfs['tabmat']).dropna(subset=['sigla_uf', 'rede']).loc[lambda df: (df['sigla_uf'] != \" \") & (df['rede'] != \" \")]" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [], + "source": [ + "dataframe[['quantidade_matricula','quantidade_matricula_aee']] = dataframe[['quantidade_matricula','quantidade_matricula_aee']].astype(int)" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [], + "source": [ + "dataframe = dataframe.sort_values(by=['ano', 'sigla_uf'], ascending=[True, True])" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
anosigla_ufredequantidade_matriculaquantidade_matricula_aee
2592019ACPública107826395
2602019ACPrivada325261
2952019ALPública2183810145
2962019ALPrivada13141832
2622019AMPública172165074
..................
472022SEPrivada1604227
612022SPPública19170868563
622022SPPrivada52146942
222022TOPública159777222
232022TOPrivada56728
\n", + "

216 rows × 5 columns

\n", + "
" + ], + "text/plain": [ + " ano sigla_uf rede quantidade_matricula quantidade_matricula_aee\n", + "259 2019 AC Pública 10782 6395\n", + "260 2019 AC Privada 325 261\n", + "295 2019 AL Pública 21838 10145\n", + "296 2019 AL Privada 1314 1832\n", + "262 2019 AM Pública 17216 5074\n", + ".. ... ... ... ... ...\n", + "47 2022 SE Privada 1604 227\n", + "61 2022 SP Pública 191708 68563\n", + "62 2022 SP Privada 52146 942\n", + "22 2022 TO Pública 15977 7222\n", + "23 2022 TO Privada 567 28\n", + "\n", + "[216 rows x 5 columns]" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dataframe" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": {}, + "outputs": [], + "source": [ + "path = os.path.join(\n", + " OUTPUT, \"educacao_especial_aee_matricula\"\n", + " )\n", + "\n", + "os.makedirs(path, exist_ok=True)\n", + "dataframe.astype(str).to_csv(os.path.join(path, \"data.csv\"), index=False)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.9.17" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/models/br_inep_educacao_especial/code/educacao_especial_distorcao_idade_serie.ipynb b/models/br_inep_educacao_especial/code/educacao_especial_distorcao_idade_serie.ipynb new file mode 100644 index 00000000..2a9c4ba5 --- /dev/null +++ b/models/br_inep_educacao_especial/code/educacao_especial_distorcao_idade_serie.ipynb @@ -0,0 +1,4066 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import zipfile\n", + "import pandas as pd\n", + "import basedosdados as bd\n", + "\n", + "INPUT = os.path.join(os.getcwd(), \"input\")\n", + "OUTPUT = os.path.join(os.getcwd(), \"output\")\n", + "\n", + "os.makedirs(INPUT, exist_ok=True)\n", + "os.makedirs(OUTPUT, exist_ok=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "def read_sheet(sheet_name: str, skiprows: int = 3) -> pd.DataFrame:\n", + " return pd.read_excel(\n", + " os.path.join(\n", + " INPUT,\n", + " \"TDI_-_Alunos_com_defici_ncia.xlsx\"\n", + " ),\n", + " skiprows=skiprows,\n", + " sheet_name=sheet_name\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "excel_data = pd.ExcelFile(os.path.join(\n", + " INPUT,\n", + " \"TDI_-_Alunos_com_defici_ncia.xlsx\"\n", + " ))\n", + "\n", + "# Get the sheet names\n", + "sheet_names = excel_data.sheet_names" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "dfs = {\n", + " sheet_name: read_sheet(sheet_name)\n", + " for sheet_name in sheet_names\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'2007': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 72.2 60.6 \n", + " 1 Norte 76.1 69.7 \n", + " 2 Nordeste 74.4 64.7 \n", + " 3 Sudeste 69.3 56.5 \n", + " 4 Sul 73.3 59.6 \n", + " 5 Centro-Oeste 78.7 73.6 \n", + " 6 Rondônia 72.8 65.8 \n", + " 7 Acre 67.2 60.0 \n", + " 8 Amazonas 76.3 75.7 \n", + " 9 Roraima 71.0 69.5 \n", + " 10 Pará 78.2 68.4 \n", + " 11 Amapá 76.4 81.0 \n", + " 12 Tocantins 75.4 70.7 \n", + " 13 Maranhão 74.2 61.2 \n", + " 14 Piauí 83.0 69.3 \n", + " 15 Ceará 67.8 56.9 \n", + " 16 Rio Grande do Norte 66.4 74.0 \n", + " 17 Paraíba 73.3 71.6 \n", + " 18 Pernambuco 78.6 64.5 \n", + " 19 Alagoas 72.0 79.2 \n", + " 20 Sergipe 85.0 85.4 \n", + " 21 Bahia 76.7 66.5 \n", + " 22 Minas Gerais 79.0 69.1 \n", + " 23 Espírito Santo 67.5 69.0 \n", + " 24 Rio de Janeiro 85.1 77.2 \n", + " 25 São Paulo 60.7 50.2 \n", + " 26 Paraná 72.3 54.2 \n", + " 27 Santa Catarina 75.8 65.3 \n", + " 28 Rio Grande do Sul 73.6 66.1 \n", + " 29 Mato Grosso do Sul 86.0 81.2 \n", + " 30 Mato Grosso 76.3 66.2 \n", + " 31 Goiás 76.8 75.7 \n", + " 32 Distrito Federal 74.6 70.6 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 65.3 \n", + " 1 75.7 \n", + " 2 77.9 \n", + " 3 58.4 \n", + " 4 62.6 \n", + " 5 73.6 \n", + " 6 76.2 \n", + " 7 60.5 \n", + " 8 75.5 \n", + " 9 76.9 \n", + " 10 77.7 \n", + " 11 69.4 \n", + " 12 75.9 \n", + " 13 76.2 \n", + " 14 80.5 \n", + " 15 83.7 \n", + " 16 78.0 \n", + " 17 88.0 \n", + " 18 81.3 \n", + " 19 88.3 \n", + " 20 85.7 \n", + " 21 67.1 \n", + " 22 69.1 \n", + " 23 69.1 \n", + " 24 86.7 \n", + " 25 51.5 \n", + " 26 59.5 \n", + " 27 71.9 \n", + " 28 60.4 \n", + " 29 75.4 \n", + " 30 78.1 \n", + " 31 75.5 \n", + " 32 69.6 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2008': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 66.5 54.5 \n", + " 1 Norte 61.2 44.8 \n", + " 2 Nordeste 60.7 45.7 \n", + " 3 Sudeste 65.7 53.5 \n", + " 4 Sul 73.5 63.2 \n", + " 5 Centro-Oeste 72.3 63.6 \n", + " 6 Rondônia 55.1 35.9 \n", + " 7 Acre 43.8 29.7 \n", + " 8 Amazonas 58.0 57.0 \n", + " 9 Roraima 44.2 28.4 \n", + " 10 Pará 65.1 48.3 \n", + " 11 Amapá 57.0 54.4 \n", + " 12 Tocantins 67.1 46.3 \n", + " 13 Maranhão 62.8 44.3 \n", + " 14 Piauí 66.3 57.9 \n", + " 15 Ceará 55.9 38.6 \n", + " 16 Rio Grande do Norte 47.1 45.2 \n", + " 17 Paraíba 54.0 48.1 \n", + " 18 Pernambuco 73.5 58.6 \n", + " 19 Alagoas 49.0 46.1 \n", + " 20 Sergipe 68.5 58.9 \n", + " 21 Bahia 60.5 44.4 \n", + " 22 Minas Gerais 73.1 61.8 \n", + " 23 Espírito Santo 62.9 61.2 \n", + " 24 Rio de Janeiro 82.7 72.7 \n", + " 25 São Paulo 57.5 48.2 \n", + " 26 Paraná 78.0 60.6 \n", + " 27 Santa Catarina 69.5 64.5 \n", + " 28 Rio Grande do Sul 70.1 65.0 \n", + " 29 Mato Grosso do Sul 84.6 75.7 \n", + " 30 Mato Grosso 72.6 66.2 \n", + " 31 Goiás 68.0 62.1 \n", + " 32 Distrito Federal 62.0 60.0 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 57.3 \n", + " 1 50.7 \n", + " 2 49.4 \n", + " 3 56.6 \n", + " 4 65.0 \n", + " 5 60.5 \n", + " 6 48.8 \n", + " 7 47.2 \n", + " 8 62.2 \n", + " 9 41.2 \n", + " 10 48.7 \n", + " 11 60.0 \n", + " 12 48.2 \n", + " 13 45.3 \n", + " 14 51.0 \n", + " 15 48.7 \n", + " 16 44.2 \n", + " 17 52.3 \n", + " 18 65.1 \n", + " 19 61.1 \n", + " 20 65.7 \n", + " 21 41.9 \n", + " 22 58.6 \n", + " 23 73.5 \n", + " 24 80.2 \n", + " 25 51.5 \n", + " 26 59.6 \n", + " 27 72.5 \n", + " 28 64.0 \n", + " 29 80.0 \n", + " 30 72.7 \n", + " 31 55.8 \n", + " 32 60.7 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2009': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 68.4 54.8 \n", + " 1 Norte 69.8 51.0 \n", + " 2 Nordeste 66.9 50.7 \n", + " 3 Sudeste 65.6 52.1 \n", + " 4 Sul 75.8 63.8 \n", + " 5 Centro-Oeste 73.1 65.6 \n", + " 6 Rondônia 64.2 47.3 \n", + " 7 Acre 51.6 37.8 \n", + " 8 Amazonas 70.6 56.7 \n", + " 9 Roraima 50.6 51.7 \n", + " 10 Pará 74.2 54.0 \n", + " 11 Amapá 64.5 49.2 \n", + " 12 Tocantins 72.8 50.5 \n", + " 13 Maranhão 64.4 48.8 \n", + " 14 Piauí 70.6 47.2 \n", + " 15 Ceará 64.3 44.5 \n", + " 16 Rio Grande do Norte 53.4 57.9 \n", + " 17 Paraíba 70.4 47.9 \n", + " 18 Pernambuco 78.3 64.5 \n", + " 19 Alagoas 54.1 58.9 \n", + " 20 Sergipe 78.2 61.1 \n", + " 21 Bahia 65.5 50.2 \n", + " 22 Minas Gerais 75.4 64.4 \n", + " 23 Espírito Santo 69.9 60.2 \n", + " 24 Rio de Janeiro 84.6 74.3 \n", + " 25 São Paulo 57.0 47.3 \n", + " 26 Paraná 80.6 61.1 \n", + " 27 Santa Catarina 57.4 61.8 \n", + " 28 Rio Grande do Sul 75.0 67.9 \n", + " 29 Mato Grosso do Sul 84.1 78.9 \n", + " 30 Mato Grosso 73.2 69.7 \n", + " 31 Goiás 65.7 61.2 \n", + " 32 Distrito Federal 66.4 64.6 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 56.0 \n", + " 1 57.5 \n", + " 2 56.6 \n", + " 3 52.1 \n", + " 4 62.1 \n", + " 5 62.2 \n", + " 6 45.1 \n", + " 7 43.4 \n", + " 8 61.4 \n", + " 9 21.4 \n", + " 10 62.1 \n", + " 11 54.7 \n", + " 12 55.2 \n", + " 13 48.2 \n", + " 14 61.4 \n", + " 15 52.6 \n", + " 16 51.1 \n", + " 17 50.2 \n", + " 18 69.3 \n", + " 19 64.1 \n", + " 20 68.9 \n", + " 21 54.4 \n", + " 22 59.9 \n", + " 23 69.9 \n", + " 24 74.8 \n", + " 25 46.0 \n", + " 26 57.4 \n", + " 27 57.4 \n", + " 28 70.3 \n", + " 29 80.6 \n", + " 30 70.9 \n", + " 31 56.2 \n", + " 32 67.5 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2010': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 67.5 57.2 \n", + " 1 Norte 70.0 59.4 \n", + " 2 Nordeste 67.1 57.8 \n", + " 3 Sudeste 65.0 52.8 \n", + " 4 Sul 72.4 62.8 \n", + " 5 Centro-Oeste 68.6 67.2 \n", + " 6 Rondônia 67.5 60.7 \n", + " 7 Acre 57.2 49.4 \n", + " 8 Amazonas 70.7 64.2 \n", + " 9 Roraima 50.6 59.2 \n", + " 10 Pará 74.9 62.5 \n", + " 11 Amapá 66.7 54.7 \n", + " 12 Tocantins 68.6 57.5 \n", + " 13 Maranhão 65.2 55.5 \n", + " 14 Piauí 69.2 56.1 \n", + " 15 Ceará 64.2 50.7 \n", + " 16 Rio Grande do Norte 56.2 66.8 \n", + " 17 Paraíba 71.7 56.5 \n", + " 18 Pernambuco 74.9 65.6 \n", + " 19 Alagoas 57.6 60.2 \n", + " 20 Sergipe 78.2 72.2 \n", + " 21 Bahia 67.4 59.3 \n", + " 22 Minas Gerais 69.3 66.1 \n", + " 23 Espírito Santo 59.1 59.0 \n", + " 24 Rio de Janeiro 82.2 73.3 \n", + " 25 São Paulo 58.4 47.4 \n", + " 26 Paraná 76.0 59.0 \n", + " 27 Santa Catarina 54.1 62.1 \n", + " 28 Rio Grande do Sul 73.0 67.8 \n", + " 29 Mato Grosso do Sul 81.2 78.7 \n", + " 30 Mato Grosso 64.6 66.7 \n", + " 31 Goiás 62.2 66.2 \n", + " 32 Distrito Federal 62.7 61.7 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 56.4 \n", + " 1 63.0 \n", + " 2 60.3 \n", + " 3 52.1 \n", + " 4 55.6 \n", + " 5 64.6 \n", + " 6 45.9 \n", + " 7 56.6 \n", + " 8 70.9 \n", + " 9 58.6 \n", + " 10 70.8 \n", + " 11 54.1 \n", + " 12 56.0 \n", + " 13 56.7 \n", + " 14 65.9 \n", + " 15 50.6 \n", + " 16 67.4 \n", + " 17 55.6 \n", + " 18 69.9 \n", + " 19 69.1 \n", + " 20 80.1 \n", + " 21 57.6 \n", + " 22 58.9 \n", + " 23 60.1 \n", + " 24 67.7 \n", + " 25 47.3 \n", + " 26 51.1 \n", + " 27 53.0 \n", + " 28 62.9 \n", + " 29 75.6 \n", + " 30 69.6 \n", + " 31 63.2 \n", + " 32 61.7 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2011': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 66.5 58.5 \n", + " 1 Norte 69.1 63.2 \n", + " 2 Nordeste 66.9 61.9 \n", + " 3 Sudeste 64.7 53.6 \n", + " 4 Sul 69.1 60.6 \n", + " 5 Centro-Oeste 66.1 66.2 \n", + " 6 Rondônia 67.5 61.4 \n", + " 7 Acre 57.1 53.4 \n", + " 8 Amazonas 69.7 69.5 \n", + " 9 Roraima 49.4 65.6 \n", + " 10 Pará 73.4 66.5 \n", + " 11 Amapá 69.8 55.4 \n", + " 12 Tocantins 67.2 62.8 \n", + " 13 Maranhão 64.8 60.2 \n", + " 14 Piauí 67.1 61.0 \n", + " 15 Ceará 62.1 56.8 \n", + " 16 Rio Grande do Norte 57.6 68.9 \n", + " 17 Paraíba 71.2 60.8 \n", + " 18 Pernambuco 74.3 67.4 \n", + " 19 Alagoas 60.4 64.5 \n", + " 20 Sergipe 78.4 73.3 \n", + " 21 Bahia 67.7 61.6 \n", + " 22 Minas Gerais 65.1 65.3 \n", + " 23 Espírito Santo 54.4 58.0 \n", + " 24 Rio de Janeiro 79.6 72.8 \n", + " 25 São Paulo 60.4 47.5 \n", + " 26 Paraná 73.5 56.1 \n", + " 27 Santa Catarina 50.3 60.1 \n", + " 28 Rio Grande do Sul 69.8 66.4 \n", + " 29 Mato Grosso do Sul 78.4 79.3 \n", + " 30 Mato Grosso 58.8 62.5 \n", + " 31 Goiás 60.5 65.1 \n", + " 32 Distrito Federal 63.0 61.0 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 56.1 \n", + " 1 62.9 \n", + " 2 59.9 \n", + " 3 52.5 \n", + " 4 54.3 \n", + " 5 62.5 \n", + " 6 51.0 \n", + " 7 51.2 \n", + " 8 68.9 \n", + " 9 48.1 \n", + " 10 69.1 \n", + " 11 57.7 \n", + " 12 62.9 \n", + " 13 54.6 \n", + " 14 63.0 \n", + " 15 57.7 \n", + " 16 68.8 \n", + " 17 50.5 \n", + " 18 65.9 \n", + " 19 62.8 \n", + " 20 73.5 \n", + " 21 57.1 \n", + " 22 59.8 \n", + " 23 59.1 \n", + " 24 66.3 \n", + " 25 47.4 \n", + " 26 50.7 \n", + " 27 51.3 \n", + " 28 61.2 \n", + " 29 68.9 \n", + " 30 64.6 \n", + " 31 63.8 \n", + " 32 57.2 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2012': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 64.4 58.9 \n", + " 1 Norte 67.0 64.7 \n", + " 2 Nordeste 66.2 63.7 \n", + " 3 Sudeste 62.0 53.1 \n", + " 4 Sul 67.1 61.4 \n", + " 5 Centro-Oeste 62.5 64.3 \n", + " 6 Rondônia 67.0 60.8 \n", + " 7 Acre 54.5 58.5 \n", + " 8 Amazonas 66.0 72.1 \n", + " 9 Roraima 43.5 62.5 \n", + " 10 Pará 70.2 67.7 \n", + " 11 Amapá 68.3 61.9 \n", + " 12 Tocantins 68.3 62.9 \n", + " 13 Maranhão 62.6 60.3 \n", + " 14 Piauí 68.5 61.3 \n", + " 15 Ceará 57.8 59.4 \n", + " 16 Rio Grande do Norte 57.6 69.9 \n", + " 17 Paraíba 69.3 61.9 \n", + " 18 Pernambuco 74.2 69.6 \n", + " 19 Alagoas 61.7 66.2 \n", + " 20 Sergipe 79.5 75.4 \n", + " 21 Bahia 68.0 64.0 \n", + " 22 Minas Gerais 57.8 63.3 \n", + " 23 Espírito Santo 50.4 59.4 \n", + " 24 Rio de Janeiro 78.8 71.8 \n", + " 25 São Paulo 59.6 46.6 \n", + " 26 Paraná 73.8 56.9 \n", + " 27 Santa Catarina 41.5 59.9 \n", + " 28 Rio Grande do Sul 67.0 67.6 \n", + " 29 Mato Grosso do Sul 77.2 78.6 \n", + " 30 Mato Grosso 47.1 57.6 \n", + " 31 Goiás 56.6 63.0 \n", + " 32 Distrito Federal 62.6 59.9 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 55.3 \n", + " 1 62.9 \n", + " 2 60.9 \n", + " 3 51.4 \n", + " 4 51.8 \n", + " 5 61.5 \n", + " 6 53.9 \n", + " 7 52.0 \n", + " 8 66.0 \n", + " 9 57.5 \n", + " 10 70.9 \n", + " 11 52.5 \n", + " 12 61.0 \n", + " 13 57.8 \n", + " 14 58.3 \n", + " 15 59.0 \n", + " 16 67.7 \n", + " 17 52.1 \n", + " 18 67.1 \n", + " 19 63.5 \n", + " 20 73.7 \n", + " 21 59.8 \n", + " 22 59.8 \n", + " 23 56.2 \n", + " 24 60.5 \n", + " 25 46.6 \n", + " 26 46.9 \n", + " 27 49.9 \n", + " 28 59.4 \n", + " 29 69.8 \n", + " 30 57.5 \n", + " 31 64.7 \n", + " 32 53.6 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2013': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 61.8 59.3 \n", + " 1 Norte 65.1 65.2 \n", + " 2 Nordeste 63.8 66.2 \n", + " 3 Sudeste 59.5 52.2 \n", + " 4 Sul 63.0 63.8 \n", + " 5 Centro-Oeste 60.1 61.6 \n", + " 6 Rondônia 66.3 62.2 \n", + " 7 Acre 55.8 56.4 \n", + " 8 Amazonas 63.2 66.0 \n", + " 9 Roraima 38.4 58.2 \n", + " 10 Pará 69.1 69.9 \n", + " 11 Amapá 64.4 60.6 \n", + " 12 Tocantins 63.3 66.0 \n", + " 13 Maranhão 60.5 61.9 \n", + " 14 Piauí 66.0 66.3 \n", + " 15 Ceará 50.2 63.1 \n", + " 16 Rio Grande do Norte 56.4 72.8 \n", + " 17 Paraíba 68.0 67.2 \n", + " 18 Pernambuco 73.1 71.1 \n", + " 19 Alagoas 61.3 65.7 \n", + " 20 Sergipe 76.4 77.6 \n", + " 21 Bahia 66.8 65.8 \n", + " 22 Minas Gerais 52.4 60.5 \n", + " 23 Espírito Santo 47.8 61.8 \n", + " 24 Rio de Janeiro 77.1 74.3 \n", + " 25 São Paulo 58.4 44.8 \n", + " 26 Paraná 70.7 59.6 \n", + " 27 Santa Catarina 35.1 59.7 \n", + " 28 Rio Grande do Sul 62.8 70.3 \n", + " 29 Mato Grosso do Sul 76.4 75.2 \n", + " 30 Mato Grosso 41.9 47.7 \n", + " 31 Goiás 53.5 64.7 \n", + " 32 Distrito Federal 63.5 58.7 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 55.4 \n", + " 1 62.0 \n", + " 2 61.9 \n", + " 3 51.0 \n", + " 4 52.9 \n", + " 5 61.4 \n", + " 6 54.1 \n", + " 7 48.6 \n", + " 8 63.9 \n", + " 9 60.3 \n", + " 10 70.6 \n", + " 11 54.4 \n", + " 12 60.4 \n", + " 13 57.8 \n", + " 14 63.2 \n", + " 15 60.9 \n", + " 16 65.5 \n", + " 17 56.9 \n", + " 18 71.0 \n", + " 19 55.5 \n", + " 20 72.9 \n", + " 21 60.0 \n", + " 22 61.1 \n", + " 23 51.7 \n", + " 24 63.1 \n", + " 25 46.1 \n", + " 26 48.2 \n", + " 27 51.8 \n", + " 28 59.4 \n", + " 29 67.8 \n", + " 30 60.5 \n", + " 31 65.1 \n", + " 32 53.9 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2014': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 58.7 59.6 \n", + " 1 Norte 60.7 65.6 \n", + " 2 Nordeste 60.4 68.1 \n", + " 3 Sudeste 56.4 51.9 \n", + " 4 Sul 61.2 64.5 \n", + " 5 Centro-Oeste 56.0 58.6 \n", + " 6 Rondônia 57.7 63.7 \n", + " 7 Acre 53.6 55.5 \n", + " 8 Amazonas 61.6 67.2 \n", + " 9 Roraima 35.5 54.8 \n", + " 10 Pará 64.8 72.0 \n", + " 11 Amapá 60.4 60.3 \n", + " 12 Tocantins 56.9 65.2 \n", + " 13 Maranhão 59.0 63.6 \n", + " 14 Piauí 62.1 68.2 \n", + " 15 Ceará 42.5 63.9 \n", + " 16 Rio Grande do Norte 52.5 74.8 \n", + " 17 Paraíba 65.0 69.4 \n", + " 18 Pernambuco 71.2 72.7 \n", + " 19 Alagoas 60.1 69.4 \n", + " 20 Sergipe 71.9 81.3 \n", + " 21 Bahia 64.4 67.9 \n", + " 22 Minas Gerais 46.0 56.6 \n", + " 23 Espírito Santo 45.6 63.0 \n", + " 24 Rio de Janeiro 75.3 73.7 \n", + " 25 São Paulo 56.1 44.9 \n", + " 26 Paraná 73.2 61.2 \n", + " 27 Santa Catarina 30.0 57.5 \n", + " 28 Rio Grande do Sul 58.9 70.9 \n", + " 29 Mato Grosso do Sul 75.1 73.4 \n", + " 30 Mato Grosso 35.0 37.8 \n", + " 31 Goiás 46.7 62.0 \n", + " 32 Distrito Federal 62.9 61.1 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 54.5 \n", + " 1 58.9 \n", + " 2 64.7 \n", + " 3 49.3 \n", + " 4 52.4 \n", + " 5 61.0 \n", + " 6 52.9 \n", + " 7 49.4 \n", + " 8 67.0 \n", + " 9 64.4 \n", + " 10 63.8 \n", + " 11 57.8 \n", + " 12 60.8 \n", + " 13 61.1 \n", + " 14 63.6 \n", + " 15 62.2 \n", + " 16 69.0 \n", + " 17 60.3 \n", + " 18 68.6 \n", + " 19 61.3 \n", + " 20 74.1 \n", + " 21 67.8 \n", + " 22 60.5 \n", + " 23 53.9 \n", + " 24 63.1 \n", + " 25 43.5 \n", + " 26 48.4 \n", + " 27 50.4 \n", + " 28 59.0 \n", + " 29 66.4 \n", + " 30 58.7 \n", + " 31 64.4 \n", + " 32 54.2 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2015': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 55.8 59.2 \n", + " 1 Norte 57.8 66.0 \n", + " 2 Nordeste 57.2 67.6 \n", + " 3 Sudeste 53.8 51.1 \n", + " 4 Sul 57.6 63.6 \n", + " 5 Centro-Oeste 53.3 56.2 \n", + " 6 Rondônia 53.0 62.4 \n", + " 7 Acre 50.5 54.1 \n", + " 8 Amazonas 59.2 65.1 \n", + " 9 Roraima 32.1 54.7 \n", + " 10 Pará 62.8 73.7 \n", + " 11 Amapá 55.7 61.7 \n", + " 12 Tocantins 53.1 64.9 \n", + " 13 Maranhão 55.3 63.7 \n", + " 14 Piauí 60.1 67.5 \n", + " 15 Ceará 36.3 60.4 \n", + " 16 Rio Grande do Norte 49.0 74.2 \n", + " 17 Paraíba 62.9 70.4 \n", + " 18 Pernambuco 69.3 73.1 \n", + " 19 Alagoas 58.1 69.9 \n", + " 20 Sergipe 68.2 81.0 \n", + " 21 Bahia 62.7 68.6 \n", + " 22 Minas Gerais 41.7 53.1 \n", + " 23 Espírito Santo 43.0 62.6 \n", + " 24 Rio de Janeiro 72.9 72.3 \n", + " 25 São Paulo 54.5 44.4 \n", + " 26 Paraná 69.7 61.2 \n", + " 27 Santa Catarina 26.5 54.1 \n", + " 28 Rio Grande do Sul 56.0 70.5 \n", + " 29 Mato Grosso do Sul 73.1 69.4 \n", + " 30 Mato Grosso 30.8 34.0 \n", + " 31 Goiás 42.7 60.6 \n", + " 32 Distrito Federal 62.1 59.7 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 53.7 \n", + " 1 58.4 \n", + " 2 64.4 \n", + " 3 48.3 \n", + " 4 52.0 \n", + " 5 58.3 \n", + " 6 53.3 \n", + " 7 49.6 \n", + " 8 68.1 \n", + " 9 54.5 \n", + " 10 65.6 \n", + " 11 55.5 \n", + " 12 58.9 \n", + " 13 61.0 \n", + " 14 65.6 \n", + " 15 62.6 \n", + " 16 69.1 \n", + " 17 60.4 \n", + " 18 66.0 \n", + " 19 57.8 \n", + " 20 73.7 \n", + " 21 67.6 \n", + " 22 60.9 \n", + " 23 54.2 \n", + " 24 62.0 \n", + " 25 41.7 \n", + " 26 48.0 \n", + " 27 50.1 \n", + " 28 58.0 \n", + " 29 67.2 \n", + " 30 52.3 \n", + " 31 61.6 \n", + " 32 52.7 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2016': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 53.5 58.2 \n", + " 1 Norte 55.7 65.6 \n", + " 2 Nordeste 54.3 66.9 \n", + " 3 Sudeste 51.4 49.7 \n", + " 4 Sul 56.9 61.2 \n", + " 5 Centro-Oeste 51.0 55.3 \n", + " 6 Rondônia 47.2 62.7 \n", + " 7 Acre 46.8 55.5 \n", + " 8 Amazonas 57.7 63.3 \n", + " 9 Roraima 28.9 52.9 \n", + " 10 Pará 61.3 73.2 \n", + " 11 Amapá 54.4 62.0 \n", + " 12 Tocantins 52.5 62.7 \n", + " 13 Maranhão 53.1 64.2 \n", + " 14 Piauí 57.3 67.5 \n", + " 15 Ceará 30.9 55.6 \n", + " 16 Rio Grande do Norte 45.4 72.9 \n", + " 17 Paraíba 60.3 71.4 \n", + " 18 Pernambuco 65.8 74.0 \n", + " 19 Alagoas 56.1 70.7 \n", + " 20 Sergipe 66.1 79.4 \n", + " 21 Bahia 61.4 69.9 \n", + " 22 Minas Gerais 39.3 50.9 \n", + " 23 Espírito Santo 40.7 59.8 \n", + " 24 Rio de Janeiro 70.1 70.2 \n", + " 25 São Paulo 51.9 43.3 \n", + " 26 Paraná 69.5 59.3 \n", + " 27 Santa Catarina 24.5 47.9 \n", + " 28 Rio Grande do Sul 54.9 68.4 \n", + " 29 Mato Grosso do Sul 71.9 67.3 \n", + " 30 Mato Grosso 30.0 31.1 \n", + " 31 Goiás 40.0 60.1 \n", + " 32 Distrito Federal 59.7 59.9 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 53.9 \n", + " 1 60.4 \n", + " 2 64.6 \n", + " 3 47.8 \n", + " 4 53.6 \n", + " 5 57.3 \n", + " 6 54.4 \n", + " 7 51.1 \n", + " 8 67.3 \n", + " 9 51.1 \n", + " 10 69.7 \n", + " 11 55.5 \n", + " 12 60.9 \n", + " 13 58.7 \n", + " 14 63.5 \n", + " 15 64.1 \n", + " 16 68.3 \n", + " 17 65.5 \n", + " 18 65.4 \n", + " 19 64.6 \n", + " 20 72.0 \n", + " 21 68.0 \n", + " 22 59.8 \n", + " 23 56.2 \n", + " 24 58.3 \n", + " 25 41.2 \n", + " 26 49.1 \n", + " 27 50.7 \n", + " 28 61.0 \n", + " 29 68.0 \n", + " 30 49.8 \n", + " 31 61.6 \n", + " 32 50.8 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2017': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 51.4 56.8 \n", + " 1 Norte 53.1 64.8 \n", + " 2 Nordeste 52.2 65.3 \n", + " 3 Sudeste 49.4 48.3 \n", + " 4 Sul 54.6 59.2 \n", + " 5 Centro-Oeste 48.2 52.5 \n", + " 6 Rondônia 42.7 60.5 \n", + " 7 Acre 45.1 54.0 \n", + " 8 Amazonas 54.5 62.9 \n", + " 9 Roraima 26.2 50.3 \n", + " 10 Pará 59.9 72.7 \n", + " 11 Amapá 53.8 60.4 \n", + " 12 Tocantins 44.1 61.6 \n", + " 13 Maranhão 50.5 63.3 \n", + " 14 Piauí 54.4 63.7 \n", + " 15 Ceará 28.4 50.8 \n", + " 16 Rio Grande do Norte 43.2 69.6 \n", + " 17 Paraíba 59.1 71.3 \n", + " 18 Pernambuco 62.6 73.2 \n", + " 19 Alagoas 55.1 69.8 \n", + " 20 Sergipe 62.3 78.4 \n", + " 21 Bahia 59.6 70.4 \n", + " 22 Minas Gerais 36.8 49.4 \n", + " 23 Espírito Santo 37.9 58.2 \n", + " 24 Rio de Janeiro 68.0 67.8 \n", + " 25 São Paulo 50.8 41.2 \n", + " 26 Paraná 66.0 58.0 \n", + " 27 Santa Catarina 23.0 44.4 \n", + " 28 Rio Grande do Sul 53.4 66.9 \n", + " 29 Mato Grosso do Sul 71.5 68.3 \n", + " 30 Mato Grosso 29.3 33.3 \n", + " 31 Goiás 37.3 54.6 \n", + " 32 Distrito Federal 56.8 56.1 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 53.1 \n", + " 1 59.9 \n", + " 2 61.8 \n", + " 3 46.7 \n", + " 4 54.9 \n", + " 5 55.5 \n", + " 6 52.2 \n", + " 7 48.1 \n", + " 8 64.1 \n", + " 9 51.2 \n", + " 10 69.8 \n", + " 11 54.6 \n", + " 12 59.5 \n", + " 13 56.2 \n", + " 14 59.9 \n", + " 15 60.8 \n", + " 16 67.9 \n", + " 17 66.9 \n", + " 18 65.2 \n", + " 19 52.6 \n", + " 20 75.2 \n", + " 21 65.7 \n", + " 22 57.4 \n", + " 23 51.5 \n", + " 24 58.6 \n", + " 25 39.6 \n", + " 26 51.2 \n", + " 27 50.5 \n", + " 28 62.0 \n", + " 29 65.6 \n", + " 30 46.4 \n", + " 31 60.5 \n", + " 32 50.5 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2018': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 48.4 55.0 \n", + " 1 Norte 49.9 62.6 \n", + " 2 Nordeste 48.9 63.4 \n", + " 3 Sudeste 46.6 46.8 \n", + " 4 Sul 52.5 57.0 \n", + " 5 Centro-Oeste 44.1 49.8 \n", + " 6 Rondônia 36.6 58.4 \n", + " 7 Acre 41.4 51.5 \n", + " 8 Amazonas 51.6 60.7 \n", + " 9 Roraima 25.2 45.0 \n", + " 10 Pará 57.7 70.7 \n", + " 11 Amapá 51.3 60.2 \n", + " 12 Tocantins 38.7 57.7 \n", + " 13 Maranhão 47.7 61.2 \n", + " 14 Piauí 50.9 62.2 \n", + " 15 Ceará 24.6 46.0 \n", + " 16 Rio Grande do Norte 41.0 67.5 \n", + " 17 Paraíba 57.0 70.7 \n", + " 18 Pernambuco 57.0 70.8 \n", + " 19 Alagoas 50.1 68.2 \n", + " 20 Sergipe 60.8 76.4 \n", + " 21 Bahia 56.8 69.9 \n", + " 22 Minas Gerais 34.0 48.1 \n", + " 23 Espírito Santo 34.5 55.4 \n", + " 24 Rio de Janeiro 64.7 66.6 \n", + " 25 São Paulo 48.3 38.8 \n", + " 26 Paraná 63.0 55.2 \n", + " 27 Santa Catarina 21.7 41.4 \n", + " 28 Rio Grande do Sul 51.9 65.4 \n", + " 29 Mato Grosso do Sul 67.4 67.6 \n", + " 30 Mato Grosso 27.9 34.6 \n", + " 31 Goiás 32.9 50.0 \n", + " 32 Distrito Federal 54.3 53.8 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 53.2 \n", + " 1 61.0 \n", + " 2 61.2 \n", + " 3 47.0 \n", + " 4 54.1 \n", + " 5 53.2 \n", + " 6 51.2 \n", + " 7 48.4 \n", + " 8 61.4 \n", + " 9 52.5 \n", + " 10 70.6 \n", + " 11 56.1 \n", + " 12 58.8 \n", + " 13 56.3 \n", + " 14 55.7 \n", + " 15 57.4 \n", + " 16 67.7 \n", + " 17 66.1 \n", + " 18 63.2 \n", + " 19 60.0 \n", + " 20 75.8 \n", + " 21 63.9 \n", + " 22 55.4 \n", + " 23 52.4 \n", + " 24 60.3 \n", + " 25 38.8 \n", + " 26 49.9 \n", + " 27 47.4 \n", + " 28 63.0 \n", + " 29 62.6 \n", + " 30 43.8 \n", + " 31 58.2 \n", + " 32 47.6 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2019': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 44.9 53.3 \n", + " 1 Norte 46.8 60.9 \n", + " 2 Nordeste 45.1 61.3 \n", + " 3 Sudeste 42.6 45.2 \n", + " 4 Sul 50.1 55.0 \n", + " 5 Centro-Oeste 41.1 48.3 \n", + " 6 Rondônia 30.9 52.9 \n", + " 7 Acre 36.9 49.6 \n", + " 8 Amazonas 49.0 59.5 \n", + " 9 Roraima 24.8 43.4 \n", + " 10 Pará 55.1 69.7 \n", + " 11 Amapá 46.4 59.8 \n", + " 12 Tocantins 35.5 55.8 \n", + " 13 Maranhão 44.7 59.9 \n", + " 14 Piauí 45.6 62.2 \n", + " 15 Ceará 21.6 40.5 \n", + " 16 Rio Grande do Norte 37.6 64.8 \n", + " 17 Paraíba 53.8 70.6 \n", + " 18 Pernambuco 51.2 68.4 \n", + " 19 Alagoas 45.0 65.0 \n", + " 20 Sergipe 57.4 75.1 \n", + " 21 Bahia 53.5 69.5 \n", + " 22 Minas Gerais 30.7 45.6 \n", + " 23 Espírito Santo 30.8 53.4 \n", + " 24 Rio de Janeiro 60.4 65.9 \n", + " 25 São Paulo 43.9 37.5 \n", + " 26 Paraná 61.6 51.5 \n", + " 27 Santa Catarina 20.0 38.7 \n", + " 28 Rio Grande do Sul 49.1 64.2 \n", + " 29 Mato Grosso do Sul 65.0 66.2 \n", + " 30 Mato Grosso 27.5 33.9 \n", + " 31 Goiás 30.2 47.7 \n", + " 32 Distrito Federal 44.8 50.5 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 51.1 \n", + " 1 59.3 \n", + " 2 59.4 \n", + " 3 44.7 \n", + " 4 50.9 \n", + " 5 51.4 \n", + " 6 48.3 \n", + " 7 46.7 \n", + " 8 62.3 \n", + " 9 47.7 \n", + " 10 68.5 \n", + " 11 51.7 \n", + " 12 56.8 \n", + " 13 54.8 \n", + " 14 55.8 \n", + " 15 52.0 \n", + " 16 66.1 \n", + " 17 64.5 \n", + " 18 65.5 \n", + " 19 59.3 \n", + " 20 74.6 \n", + " 21 63.1 \n", + " 22 50.7 \n", + " 23 50.2 \n", + " 24 59.5 \n", + " 25 36.9 \n", + " 26 45.2 \n", + " 27 43.0 \n", + " 28 59.4 \n", + " 29 59.2 \n", + " 30 43.9 \n", + " 31 56.0 \n", + " 32 45.1 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2020': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 41.7 51.6 \n", + " 1 Norte 44.0 58.8 \n", + " 2 Nordeste 40.9 59.3 \n", + " 3 Sudeste 39.3 43.8 \n", + " 4 Sul 48.2 53.7 \n", + " 5 Centro-Oeste 38.1 45.4 \n", + " 6 Rondônia 29.2 47.8 \n", + " 7 Acre 34.9 47.4 \n", + " 8 Amazonas 45.9 57.8 \n", + " 9 Roraima 25.2 37.0 \n", + " 10 Pará 52.0 68.6 \n", + " 11 Amapá 41.1 59.7 \n", + " 12 Tocantins 32.2 52.9 \n", + " 13 Maranhão 41.2 58.6 \n", + " 14 Piauí 39.8 58.2 \n", + " 15 Ceará 18.4 37.1 \n", + " 16 Rio Grande do Norte 33.4 62.5 \n", + " 17 Paraíba 50.3 68.4 \n", + " 18 Pernambuco 43.5 65.2 \n", + " 19 Alagoas 39.7 61.2 \n", + " 20 Sergipe 53.9 74.8 \n", + " 21 Bahia 50.6 68.8 \n", + " 22 Minas Gerais 28.2 44.7 \n", + " 23 Espírito Santo 27.9 51.2 \n", + " 24 Rio de Janeiro 55.4 64.5 \n", + " 25 São Paulo 40.7 35.4 \n", + " 26 Paraná 61.5 49.7 \n", + " 27 Santa Catarina 18.7 37.4 \n", + " 28 Rio Grande do Sul 46.0 63.8 \n", + " 29 Mato Grosso do Sul 61.7 65.3 \n", + " 30 Mato Grosso 24.5 35.0 \n", + " 31 Goiás 29.2 42.5 \n", + " 32 Distrito Federal 39.9 49.1 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 50.3 \n", + " 1 58.5 \n", + " 2 58.5 \n", + " 3 44.2 \n", + " 4 48.8 \n", + " 5 49.4 \n", + " 6 49.1 \n", + " 7 46.7 \n", + " 8 58.6 \n", + " 9 48.3 \n", + " 10 67.6 \n", + " 11 52.2 \n", + " 12 54.8 \n", + " 13 52.4 \n", + " 14 55.8 \n", + " 15 49.2 \n", + " 16 62.7 \n", + " 17 62.1 \n", + " 18 63.7 \n", + " 19 58.8 \n", + " 20 71.3 \n", + " 21 64.9 \n", + " 22 49.6 \n", + " 23 49.4 \n", + " 24 60.4 \n", + " 25 35.7 \n", + " 26 44.3 \n", + " 27 40.0 \n", + " 28 58.0 \n", + " 29 59.3 \n", + " 30 42.7 \n", + " 31 51.9 \n", + " 32 44.3 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2021': Unnamed: 0 Unnamed: 1 \\\n", + " 0 NaN 0 \n", + " 1 NaN 1 \n", + " 2 NaN 2 \n", + " 3 NaN 3 \n", + " 4 NaN 4 \n", + " 5 NaN 5 \n", + " 6 NaN 11 \n", + " 7 NaN 12 \n", + " 8 NaN 13 \n", + " 9 NaN 14 \n", + " 10 NaN 15 \n", + " 11 NaN 16 \n", + " 12 NaN 17 \n", + " 13 NaN 21 \n", + " 14 NaN 22 \n", + " 15 NaN 23 \n", + " 16 NaN 24 \n", + " 17 NaN 25 \n", + " 18 NaN 26 \n", + " 19 NaN 27 \n", + " 20 NaN 28 \n", + " 21 NaN 29 \n", + " 22 NaN 31 \n", + " 23 NaN 32 \n", + " 24 NaN 33 \n", + " 25 NaN 35 \n", + " 26 NaN 41 \n", + " 27 NaN 42 \n", + " 28 NaN 43 \n", + " 29 NaN 50 \n", + " 30 NaN 51 \n", + " 31 NaN 52 \n", + " 32 NaN 53 \n", + " 33 NaN NaN \n", + " 34 NaN Notas: Foram consideradas a rede total (escola... \n", + " \n", + " Unnamed: 2 Distorção Idade-Série Distorção Idade-Série.1 \\\n", + " 0 Brasil 36.6 49.5 \n", + " 1 Norte 36.8 57.7 \n", + " 2 Nordeste 34.2 56.9 \n", + " 3 Sudeste 36.2 41.1 \n", + " 4 Sul 43.1 51.1 \n", + " 5 Centro-Oeste 33.6 43.3 \n", + " 6 Rondônia 23.4 43.6 \n", + " 7 Acre 27.9 46.2 \n", + " 8 Amazonas 39.8 56.7 \n", + " 9 Roraima 20.5 35.8 \n", + " 10 Pará 43.4 68.1 \n", + " 11 Amapá 34.0 58.8 \n", + " 12 Tocantins 27.0 48.7 \n", + " 13 Maranhão 35.3 56.5 \n", + " 14 Piauí 33.2 56.3 \n", + " 15 Ceará 14.6 33.3 \n", + " 16 Rio Grande do Norte 23.6 60.1 \n", + " 17 Paraíba 42.4 65.7 \n", + " 18 Pernambuco 36.4 60.8 \n", + " 19 Alagoas 32.2 57.4 \n", + " 20 Sergipe 44.5 72.2 \n", + " 21 Bahia 42.9 66.6 \n", + " 22 Minas Gerais 25.0 40.4 \n", + " 23 Espírito Santo 20.4 47.6 \n", + " 24 Rio de Janeiro 49.3 63.4 \n", + " 25 São Paulo 38.8 32.6 \n", + " 26 Paraná 60.2 46.1 \n", + " 27 Santa Catarina 14.6 35.1 \n", + " 28 Rio Grande do Sul 37.6 61.6 \n", + " 29 Mato Grosso do Sul 56.0 63.4 \n", + " 30 Mato Grosso 21.1 32.3 \n", + " 31 Goiás 25.2 39.8 \n", + " 32 Distrito Federal 36.0 48.9 \n", + " 33 NaN NaN NaN \n", + " 34 NaN NaN NaN \n", + " \n", + " Distorção Idade-Série.2 \n", + " 0 48.3 \n", + " 1 57.5 \n", + " 2 57.8 \n", + " 3 41.8 \n", + " 4 44.9 \n", + " 5 46.1 \n", + " 6 48.7 \n", + " 7 44.4 \n", + " 8 55.9 \n", + " 9 43.7 \n", + " 10 66.7 \n", + " 11 54.5 \n", + " 12 52.9 \n", + " 13 50.8 \n", + " 14 55.3 \n", + " 15 44.4 \n", + " 16 59.9 \n", + " 17 61.8 \n", + " 18 61.3 \n", + " 19 58.9 \n", + " 20 68.7 \n", + " 21 68.6 \n", + " 22 45.1 \n", + " 23 47.3 \n", + " 24 57.8 \n", + " 25 34.9 \n", + " 26 40.6 \n", + " 27 37.1 \n", + " 28 53.2 \n", + " 29 57.9 \n", + " 30 40.7 \n", + " 31 46.5 \n", + " 32 43.6 \n", + " 33 NaN \n", + " 34 NaN }" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dfs" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sheet: 2007\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2008\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2009\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2010\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2011\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2012\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2013\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2014\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2015\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2016\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2017\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2018\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2019\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2020\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2021\n", + "Index(['Unnamed: 0', 'Unnamed: 1', 'Unnamed: 2', 'Distorção Idade-Série',\n", + " 'Distorção Idade-Série.1', 'Distorção Idade-Série.2'],\n", + " dtype='object')\n", + "\n" + ] + } + ], + "source": [ + "for sheet_name, df in dfs.items():\n", + " print(f\"Sheet: {sheet_name}\")\n", + " print(df.columns) # This will print the column names of each DataFrame\n", + " print() # Adds a blank line for readability\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "dataframes = {}\n", + "\n", + "for table_name, columns in dfs.items():\n", + " df = pd.DataFrame(columns) # Create DataFrame for each table\n", + " dataframes[table_name] = df # Store the DataFrame in a dictionary\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "RENAME_COLUMNS = {\n", + " 'Unnamed: 1':'id_uf',\n", + " 'Unnamed: 2':'nome',\n", + " 'Distorção Idade-Série': 'Ensino Fundamental – Anos Iniciais',\n", + " 'Distorção Idade-Série.1':'Ensino Fundamental – Anos Finais',\n", + " 'Distorção Idade-Série.2':'Ensino Médio Regular' \n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "def drop_unused_columns(df: pd.DataFrame) -> pd.DataFrame:\n", + " cols_drop = [\n", + " col\n", + " for col in df.columns\n", + " if col.startswith(\"Unnamed\")\n", + " ]\n", + "\n", + " return df.drop(columns=cols_drop)\n", + "\n", + "dfs = {\n", + " name: drop_unused_columns(\n", + " df.rename(columns=RENAME_COLUMNS, errors=\"raise\")\n", + " )\n", + " for name, df in dfs.items()\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'2007': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 72.2 60.6 \n", + " 1 76.1 69.7 \n", + " 2 74.4 64.7 \n", + " 3 69.3 56.5 \n", + " 4 73.3 59.6 \n", + " 5 78.7 73.6 \n", + " 6 72.8 65.8 \n", + " 7 67.2 60.0 \n", + " 8 76.3 75.7 \n", + " 9 71.0 69.5 \n", + " 10 78.2 68.4 \n", + " 11 76.4 81.0 \n", + " 12 75.4 70.7 \n", + " 13 74.2 61.2 \n", + " 14 83.0 69.3 \n", + " 15 67.8 56.9 \n", + " 16 66.4 74.0 \n", + " 17 73.3 71.6 \n", + " 18 78.6 64.5 \n", + " 19 72.0 79.2 \n", + " 20 85.0 85.4 \n", + " 21 76.7 66.5 \n", + " 22 79.0 69.1 \n", + " 23 67.5 69.0 \n", + " 24 85.1 77.2 \n", + " 25 60.7 50.2 \n", + " 26 72.3 54.2 \n", + " 27 75.8 65.3 \n", + " 28 73.6 66.1 \n", + " 29 86.0 81.2 \n", + " 30 76.3 66.2 \n", + " 31 76.8 75.7 \n", + " 32 74.6 70.6 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 65.3 \n", + " 1 75.7 \n", + " 2 77.9 \n", + " 3 58.4 \n", + " 4 62.6 \n", + " 5 73.6 \n", + " 6 76.2 \n", + " 7 60.5 \n", + " 8 75.5 \n", + " 9 76.9 \n", + " 10 77.7 \n", + " 11 69.4 \n", + " 12 75.9 \n", + " 13 76.2 \n", + " 14 80.5 \n", + " 15 83.7 \n", + " 16 78.0 \n", + " 17 88.0 \n", + " 18 81.3 \n", + " 19 88.3 \n", + " 20 85.7 \n", + " 21 67.1 \n", + " 22 69.1 \n", + " 23 69.1 \n", + " 24 86.7 \n", + " 25 51.5 \n", + " 26 59.5 \n", + " 27 71.9 \n", + " 28 60.4 \n", + " 29 75.4 \n", + " 30 78.1 \n", + " 31 75.5 \n", + " 32 69.6 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2008': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 66.5 54.5 \n", + " 1 61.2 44.8 \n", + " 2 60.7 45.7 \n", + " 3 65.7 53.5 \n", + " 4 73.5 63.2 \n", + " 5 72.3 63.6 \n", + " 6 55.1 35.9 \n", + " 7 43.8 29.7 \n", + " 8 58.0 57.0 \n", + " 9 44.2 28.4 \n", + " 10 65.1 48.3 \n", + " 11 57.0 54.4 \n", + " 12 67.1 46.3 \n", + " 13 62.8 44.3 \n", + " 14 66.3 57.9 \n", + " 15 55.9 38.6 \n", + " 16 47.1 45.2 \n", + " 17 54.0 48.1 \n", + " 18 73.5 58.6 \n", + " 19 49.0 46.1 \n", + " 20 68.5 58.9 \n", + " 21 60.5 44.4 \n", + " 22 73.1 61.8 \n", + " 23 62.9 61.2 \n", + " 24 82.7 72.7 \n", + " 25 57.5 48.2 \n", + " 26 78.0 60.6 \n", + " 27 69.5 64.5 \n", + " 28 70.1 65.0 \n", + " 29 84.6 75.7 \n", + " 30 72.6 66.2 \n", + " 31 68.0 62.1 \n", + " 32 62.0 60.0 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 57.3 \n", + " 1 50.7 \n", + " 2 49.4 \n", + " 3 56.6 \n", + " 4 65.0 \n", + " 5 60.5 \n", + " 6 48.8 \n", + " 7 47.2 \n", + " 8 62.2 \n", + " 9 41.2 \n", + " 10 48.7 \n", + " 11 60.0 \n", + " 12 48.2 \n", + " 13 45.3 \n", + " 14 51.0 \n", + " 15 48.7 \n", + " 16 44.2 \n", + " 17 52.3 \n", + " 18 65.1 \n", + " 19 61.1 \n", + " 20 65.7 \n", + " 21 41.9 \n", + " 22 58.6 \n", + " 23 73.5 \n", + " 24 80.2 \n", + " 25 51.5 \n", + " 26 59.6 \n", + " 27 72.5 \n", + " 28 64.0 \n", + " 29 80.0 \n", + " 30 72.7 \n", + " 31 55.8 \n", + " 32 60.7 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2009': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 68.4 54.8 \n", + " 1 69.8 51.0 \n", + " 2 66.9 50.7 \n", + " 3 65.6 52.1 \n", + " 4 75.8 63.8 \n", + " 5 73.1 65.6 \n", + " 6 64.2 47.3 \n", + " 7 51.6 37.8 \n", + " 8 70.6 56.7 \n", + " 9 50.6 51.7 \n", + " 10 74.2 54.0 \n", + " 11 64.5 49.2 \n", + " 12 72.8 50.5 \n", + " 13 64.4 48.8 \n", + " 14 70.6 47.2 \n", + " 15 64.3 44.5 \n", + " 16 53.4 57.9 \n", + " 17 70.4 47.9 \n", + " 18 78.3 64.5 \n", + " 19 54.1 58.9 \n", + " 20 78.2 61.1 \n", + " 21 65.5 50.2 \n", + " 22 75.4 64.4 \n", + " 23 69.9 60.2 \n", + " 24 84.6 74.3 \n", + " 25 57.0 47.3 \n", + " 26 80.6 61.1 \n", + " 27 57.4 61.8 \n", + " 28 75.0 67.9 \n", + " 29 84.1 78.9 \n", + " 30 73.2 69.7 \n", + " 31 65.7 61.2 \n", + " 32 66.4 64.6 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 56.0 \n", + " 1 57.5 \n", + " 2 56.6 \n", + " 3 52.1 \n", + " 4 62.1 \n", + " 5 62.2 \n", + " 6 45.1 \n", + " 7 43.4 \n", + " 8 61.4 \n", + " 9 21.4 \n", + " 10 62.1 \n", + " 11 54.7 \n", + " 12 55.2 \n", + " 13 48.2 \n", + " 14 61.4 \n", + " 15 52.6 \n", + " 16 51.1 \n", + " 17 50.2 \n", + " 18 69.3 \n", + " 19 64.1 \n", + " 20 68.9 \n", + " 21 54.4 \n", + " 22 59.9 \n", + " 23 69.9 \n", + " 24 74.8 \n", + " 25 46.0 \n", + " 26 57.4 \n", + " 27 57.4 \n", + " 28 70.3 \n", + " 29 80.6 \n", + " 30 70.9 \n", + " 31 56.2 \n", + " 32 67.5 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2010': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 67.5 57.2 \n", + " 1 70.0 59.4 \n", + " 2 67.1 57.8 \n", + " 3 65.0 52.8 \n", + " 4 72.4 62.8 \n", + " 5 68.6 67.2 \n", + " 6 67.5 60.7 \n", + " 7 57.2 49.4 \n", + " 8 70.7 64.2 \n", + " 9 50.6 59.2 \n", + " 10 74.9 62.5 \n", + " 11 66.7 54.7 \n", + " 12 68.6 57.5 \n", + " 13 65.2 55.5 \n", + " 14 69.2 56.1 \n", + " 15 64.2 50.7 \n", + " 16 56.2 66.8 \n", + " 17 71.7 56.5 \n", + " 18 74.9 65.6 \n", + " 19 57.6 60.2 \n", + " 20 78.2 72.2 \n", + " 21 67.4 59.3 \n", + " 22 69.3 66.1 \n", + " 23 59.1 59.0 \n", + " 24 82.2 73.3 \n", + " 25 58.4 47.4 \n", + " 26 76.0 59.0 \n", + " 27 54.1 62.1 \n", + " 28 73.0 67.8 \n", + " 29 81.2 78.7 \n", + " 30 64.6 66.7 \n", + " 31 62.2 66.2 \n", + " 32 62.7 61.7 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 56.4 \n", + " 1 63.0 \n", + " 2 60.3 \n", + " 3 52.1 \n", + " 4 55.6 \n", + " 5 64.6 \n", + " 6 45.9 \n", + " 7 56.6 \n", + " 8 70.9 \n", + " 9 58.6 \n", + " 10 70.8 \n", + " 11 54.1 \n", + " 12 56.0 \n", + " 13 56.7 \n", + " 14 65.9 \n", + " 15 50.6 \n", + " 16 67.4 \n", + " 17 55.6 \n", + " 18 69.9 \n", + " 19 69.1 \n", + " 20 80.1 \n", + " 21 57.6 \n", + " 22 58.9 \n", + " 23 60.1 \n", + " 24 67.7 \n", + " 25 47.3 \n", + " 26 51.1 \n", + " 27 53.0 \n", + " 28 62.9 \n", + " 29 75.6 \n", + " 30 69.6 \n", + " 31 63.2 \n", + " 32 61.7 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2011': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 66.5 58.5 \n", + " 1 69.1 63.2 \n", + " 2 66.9 61.9 \n", + " 3 64.7 53.6 \n", + " 4 69.1 60.6 \n", + " 5 66.1 66.2 \n", + " 6 67.5 61.4 \n", + " 7 57.1 53.4 \n", + " 8 69.7 69.5 \n", + " 9 49.4 65.6 \n", + " 10 73.4 66.5 \n", + " 11 69.8 55.4 \n", + " 12 67.2 62.8 \n", + " 13 64.8 60.2 \n", + " 14 67.1 61.0 \n", + " 15 62.1 56.8 \n", + " 16 57.6 68.9 \n", + " 17 71.2 60.8 \n", + " 18 74.3 67.4 \n", + " 19 60.4 64.5 \n", + " 20 78.4 73.3 \n", + " 21 67.7 61.6 \n", + " 22 65.1 65.3 \n", + " 23 54.4 58.0 \n", + " 24 79.6 72.8 \n", + " 25 60.4 47.5 \n", + " 26 73.5 56.1 \n", + " 27 50.3 60.1 \n", + " 28 69.8 66.4 \n", + " 29 78.4 79.3 \n", + " 30 58.8 62.5 \n", + " 31 60.5 65.1 \n", + " 32 63.0 61.0 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 56.1 \n", + " 1 62.9 \n", + " 2 59.9 \n", + " 3 52.5 \n", + " 4 54.3 \n", + " 5 62.5 \n", + " 6 51.0 \n", + " 7 51.2 \n", + " 8 68.9 \n", + " 9 48.1 \n", + " 10 69.1 \n", + " 11 57.7 \n", + " 12 62.9 \n", + " 13 54.6 \n", + " 14 63.0 \n", + " 15 57.7 \n", + " 16 68.8 \n", + " 17 50.5 \n", + " 18 65.9 \n", + " 19 62.8 \n", + " 20 73.5 \n", + " 21 57.1 \n", + " 22 59.8 \n", + " 23 59.1 \n", + " 24 66.3 \n", + " 25 47.4 \n", + " 26 50.7 \n", + " 27 51.3 \n", + " 28 61.2 \n", + " 29 68.9 \n", + " 30 64.6 \n", + " 31 63.8 \n", + " 32 57.2 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2012': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 64.4 58.9 \n", + " 1 67.0 64.7 \n", + " 2 66.2 63.7 \n", + " 3 62.0 53.1 \n", + " 4 67.1 61.4 \n", + " 5 62.5 64.3 \n", + " 6 67.0 60.8 \n", + " 7 54.5 58.5 \n", + " 8 66.0 72.1 \n", + " 9 43.5 62.5 \n", + " 10 70.2 67.7 \n", + " 11 68.3 61.9 \n", + " 12 68.3 62.9 \n", + " 13 62.6 60.3 \n", + " 14 68.5 61.3 \n", + " 15 57.8 59.4 \n", + " 16 57.6 69.9 \n", + " 17 69.3 61.9 \n", + " 18 74.2 69.6 \n", + " 19 61.7 66.2 \n", + " 20 79.5 75.4 \n", + " 21 68.0 64.0 \n", + " 22 57.8 63.3 \n", + " 23 50.4 59.4 \n", + " 24 78.8 71.8 \n", + " 25 59.6 46.6 \n", + " 26 73.8 56.9 \n", + " 27 41.5 59.9 \n", + " 28 67.0 67.6 \n", + " 29 77.2 78.6 \n", + " 30 47.1 57.6 \n", + " 31 56.6 63.0 \n", + " 32 62.6 59.9 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 55.3 \n", + " 1 62.9 \n", + " 2 60.9 \n", + " 3 51.4 \n", + " 4 51.8 \n", + " 5 61.5 \n", + " 6 53.9 \n", + " 7 52.0 \n", + " 8 66.0 \n", + " 9 57.5 \n", + " 10 70.9 \n", + " 11 52.5 \n", + " 12 61.0 \n", + " 13 57.8 \n", + " 14 58.3 \n", + " 15 59.0 \n", + " 16 67.7 \n", + " 17 52.1 \n", + " 18 67.1 \n", + " 19 63.5 \n", + " 20 73.7 \n", + " 21 59.8 \n", + " 22 59.8 \n", + " 23 56.2 \n", + " 24 60.5 \n", + " 25 46.6 \n", + " 26 46.9 \n", + " 27 49.9 \n", + " 28 59.4 \n", + " 29 69.8 \n", + " 30 57.5 \n", + " 31 64.7 \n", + " 32 53.6 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2013': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 61.8 59.3 \n", + " 1 65.1 65.2 \n", + " 2 63.8 66.2 \n", + " 3 59.5 52.2 \n", + " 4 63.0 63.8 \n", + " 5 60.1 61.6 \n", + " 6 66.3 62.2 \n", + " 7 55.8 56.4 \n", + " 8 63.2 66.0 \n", + " 9 38.4 58.2 \n", + " 10 69.1 69.9 \n", + " 11 64.4 60.6 \n", + " 12 63.3 66.0 \n", + " 13 60.5 61.9 \n", + " 14 66.0 66.3 \n", + " 15 50.2 63.1 \n", + " 16 56.4 72.8 \n", + " 17 68.0 67.2 \n", + " 18 73.1 71.1 \n", + " 19 61.3 65.7 \n", + " 20 76.4 77.6 \n", + " 21 66.8 65.8 \n", + " 22 52.4 60.5 \n", + " 23 47.8 61.8 \n", + " 24 77.1 74.3 \n", + " 25 58.4 44.8 \n", + " 26 70.7 59.6 \n", + " 27 35.1 59.7 \n", + " 28 62.8 70.3 \n", + " 29 76.4 75.2 \n", + " 30 41.9 47.7 \n", + " 31 53.5 64.7 \n", + " 32 63.5 58.7 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 55.4 \n", + " 1 62.0 \n", + " 2 61.9 \n", + " 3 51.0 \n", + " 4 52.9 \n", + " 5 61.4 \n", + " 6 54.1 \n", + " 7 48.6 \n", + " 8 63.9 \n", + " 9 60.3 \n", + " 10 70.6 \n", + " 11 54.4 \n", + " 12 60.4 \n", + " 13 57.8 \n", + " 14 63.2 \n", + " 15 60.9 \n", + " 16 65.5 \n", + " 17 56.9 \n", + " 18 71.0 \n", + " 19 55.5 \n", + " 20 72.9 \n", + " 21 60.0 \n", + " 22 61.1 \n", + " 23 51.7 \n", + " 24 63.1 \n", + " 25 46.1 \n", + " 26 48.2 \n", + " 27 51.8 \n", + " 28 59.4 \n", + " 29 67.8 \n", + " 30 60.5 \n", + " 31 65.1 \n", + " 32 53.9 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2014': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 58.7 59.6 \n", + " 1 60.7 65.6 \n", + " 2 60.4 68.1 \n", + " 3 56.4 51.9 \n", + " 4 61.2 64.5 \n", + " 5 56.0 58.6 \n", + " 6 57.7 63.7 \n", + " 7 53.6 55.5 \n", + " 8 61.6 67.2 \n", + " 9 35.5 54.8 \n", + " 10 64.8 72.0 \n", + " 11 60.4 60.3 \n", + " 12 56.9 65.2 \n", + " 13 59.0 63.6 \n", + " 14 62.1 68.2 \n", + " 15 42.5 63.9 \n", + " 16 52.5 74.8 \n", + " 17 65.0 69.4 \n", + " 18 71.2 72.7 \n", + " 19 60.1 69.4 \n", + " 20 71.9 81.3 \n", + " 21 64.4 67.9 \n", + " 22 46.0 56.6 \n", + " 23 45.6 63.0 \n", + " 24 75.3 73.7 \n", + " 25 56.1 44.9 \n", + " 26 73.2 61.2 \n", + " 27 30.0 57.5 \n", + " 28 58.9 70.9 \n", + " 29 75.1 73.4 \n", + " 30 35.0 37.8 \n", + " 31 46.7 62.0 \n", + " 32 62.9 61.1 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 54.5 \n", + " 1 58.9 \n", + " 2 64.7 \n", + " 3 49.3 \n", + " 4 52.4 \n", + " 5 61.0 \n", + " 6 52.9 \n", + " 7 49.4 \n", + " 8 67.0 \n", + " 9 64.4 \n", + " 10 63.8 \n", + " 11 57.8 \n", + " 12 60.8 \n", + " 13 61.1 \n", + " 14 63.6 \n", + " 15 62.2 \n", + " 16 69.0 \n", + " 17 60.3 \n", + " 18 68.6 \n", + " 19 61.3 \n", + " 20 74.1 \n", + " 21 67.8 \n", + " 22 60.5 \n", + " 23 53.9 \n", + " 24 63.1 \n", + " 25 43.5 \n", + " 26 48.4 \n", + " 27 50.4 \n", + " 28 59.0 \n", + " 29 66.4 \n", + " 30 58.7 \n", + " 31 64.4 \n", + " 32 54.2 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2015': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 55.8 59.2 \n", + " 1 57.8 66.0 \n", + " 2 57.2 67.6 \n", + " 3 53.8 51.1 \n", + " 4 57.6 63.6 \n", + " 5 53.3 56.2 \n", + " 6 53.0 62.4 \n", + " 7 50.5 54.1 \n", + " 8 59.2 65.1 \n", + " 9 32.1 54.7 \n", + " 10 62.8 73.7 \n", + " 11 55.7 61.7 \n", + " 12 53.1 64.9 \n", + " 13 55.3 63.7 \n", + " 14 60.1 67.5 \n", + " 15 36.3 60.4 \n", + " 16 49.0 74.2 \n", + " 17 62.9 70.4 \n", + " 18 69.3 73.1 \n", + " 19 58.1 69.9 \n", + " 20 68.2 81.0 \n", + " 21 62.7 68.6 \n", + " 22 41.7 53.1 \n", + " 23 43.0 62.6 \n", + " 24 72.9 72.3 \n", + " 25 54.5 44.4 \n", + " 26 69.7 61.2 \n", + " 27 26.5 54.1 \n", + " 28 56.0 70.5 \n", + " 29 73.1 69.4 \n", + " 30 30.8 34.0 \n", + " 31 42.7 60.6 \n", + " 32 62.1 59.7 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 53.7 \n", + " 1 58.4 \n", + " 2 64.4 \n", + " 3 48.3 \n", + " 4 52.0 \n", + " 5 58.3 \n", + " 6 53.3 \n", + " 7 49.6 \n", + " 8 68.1 \n", + " 9 54.5 \n", + " 10 65.6 \n", + " 11 55.5 \n", + " 12 58.9 \n", + " 13 61.0 \n", + " 14 65.6 \n", + " 15 62.6 \n", + " 16 69.1 \n", + " 17 60.4 \n", + " 18 66.0 \n", + " 19 57.8 \n", + " 20 73.7 \n", + " 21 67.6 \n", + " 22 60.9 \n", + " 23 54.2 \n", + " 24 62.0 \n", + " 25 41.7 \n", + " 26 48.0 \n", + " 27 50.1 \n", + " 28 58.0 \n", + " 29 67.2 \n", + " 30 52.3 \n", + " 31 61.6 \n", + " 32 52.7 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2016': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 53.5 58.2 \n", + " 1 55.7 65.6 \n", + " 2 54.3 66.9 \n", + " 3 51.4 49.7 \n", + " 4 56.9 61.2 \n", + " 5 51.0 55.3 \n", + " 6 47.2 62.7 \n", + " 7 46.8 55.5 \n", + " 8 57.7 63.3 \n", + " 9 28.9 52.9 \n", + " 10 61.3 73.2 \n", + " 11 54.4 62.0 \n", + " 12 52.5 62.7 \n", + " 13 53.1 64.2 \n", + " 14 57.3 67.5 \n", + " 15 30.9 55.6 \n", + " 16 45.4 72.9 \n", + " 17 60.3 71.4 \n", + " 18 65.8 74.0 \n", + " 19 56.1 70.7 \n", + " 20 66.1 79.4 \n", + " 21 61.4 69.9 \n", + " 22 39.3 50.9 \n", + " 23 40.7 59.8 \n", + " 24 70.1 70.2 \n", + " 25 51.9 43.3 \n", + " 26 69.5 59.3 \n", + " 27 24.5 47.9 \n", + " 28 54.9 68.4 \n", + " 29 71.9 67.3 \n", + " 30 30.0 31.1 \n", + " 31 40.0 60.1 \n", + " 32 59.7 59.9 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 53.9 \n", + " 1 60.4 \n", + " 2 64.6 \n", + " 3 47.8 \n", + " 4 53.6 \n", + " 5 57.3 \n", + " 6 54.4 \n", + " 7 51.1 \n", + " 8 67.3 \n", + " 9 51.1 \n", + " 10 69.7 \n", + " 11 55.5 \n", + " 12 60.9 \n", + " 13 58.7 \n", + " 14 63.5 \n", + " 15 64.1 \n", + " 16 68.3 \n", + " 17 65.5 \n", + " 18 65.4 \n", + " 19 64.6 \n", + " 20 72.0 \n", + " 21 68.0 \n", + " 22 59.8 \n", + " 23 56.2 \n", + " 24 58.3 \n", + " 25 41.2 \n", + " 26 49.1 \n", + " 27 50.7 \n", + " 28 61.0 \n", + " 29 68.0 \n", + " 30 49.8 \n", + " 31 61.6 \n", + " 32 50.8 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2017': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 51.4 56.8 \n", + " 1 53.1 64.8 \n", + " 2 52.2 65.3 \n", + " 3 49.4 48.3 \n", + " 4 54.6 59.2 \n", + " 5 48.2 52.5 \n", + " 6 42.7 60.5 \n", + " 7 45.1 54.0 \n", + " 8 54.5 62.9 \n", + " 9 26.2 50.3 \n", + " 10 59.9 72.7 \n", + " 11 53.8 60.4 \n", + " 12 44.1 61.6 \n", + " 13 50.5 63.3 \n", + " 14 54.4 63.7 \n", + " 15 28.4 50.8 \n", + " 16 43.2 69.6 \n", + " 17 59.1 71.3 \n", + " 18 62.6 73.2 \n", + " 19 55.1 69.8 \n", + " 20 62.3 78.4 \n", + " 21 59.6 70.4 \n", + " 22 36.8 49.4 \n", + " 23 37.9 58.2 \n", + " 24 68.0 67.8 \n", + " 25 50.8 41.2 \n", + " 26 66.0 58.0 \n", + " 27 23.0 44.4 \n", + " 28 53.4 66.9 \n", + " 29 71.5 68.3 \n", + " 30 29.3 33.3 \n", + " 31 37.3 54.6 \n", + " 32 56.8 56.1 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 53.1 \n", + " 1 59.9 \n", + " 2 61.8 \n", + " 3 46.7 \n", + " 4 54.9 \n", + " 5 55.5 \n", + " 6 52.2 \n", + " 7 48.1 \n", + " 8 64.1 \n", + " 9 51.2 \n", + " 10 69.8 \n", + " 11 54.6 \n", + " 12 59.5 \n", + " 13 56.2 \n", + " 14 59.9 \n", + " 15 60.8 \n", + " 16 67.9 \n", + " 17 66.9 \n", + " 18 65.2 \n", + " 19 52.6 \n", + " 20 75.2 \n", + " 21 65.7 \n", + " 22 57.4 \n", + " 23 51.5 \n", + " 24 58.6 \n", + " 25 39.6 \n", + " 26 51.2 \n", + " 27 50.5 \n", + " 28 62.0 \n", + " 29 65.6 \n", + " 30 46.4 \n", + " 31 60.5 \n", + " 32 50.5 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2018': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 48.4 55.0 \n", + " 1 49.9 62.6 \n", + " 2 48.9 63.4 \n", + " 3 46.6 46.8 \n", + " 4 52.5 57.0 \n", + " 5 44.1 49.8 \n", + " 6 36.6 58.4 \n", + " 7 41.4 51.5 \n", + " 8 51.6 60.7 \n", + " 9 25.2 45.0 \n", + " 10 57.7 70.7 \n", + " 11 51.3 60.2 \n", + " 12 38.7 57.7 \n", + " 13 47.7 61.2 \n", + " 14 50.9 62.2 \n", + " 15 24.6 46.0 \n", + " 16 41.0 67.5 \n", + " 17 57.0 70.7 \n", + " 18 57.0 70.8 \n", + " 19 50.1 68.2 \n", + " 20 60.8 76.4 \n", + " 21 56.8 69.9 \n", + " 22 34.0 48.1 \n", + " 23 34.5 55.4 \n", + " 24 64.7 66.6 \n", + " 25 48.3 38.8 \n", + " 26 63.0 55.2 \n", + " 27 21.7 41.4 \n", + " 28 51.9 65.4 \n", + " 29 67.4 67.6 \n", + " 30 27.9 34.6 \n", + " 31 32.9 50.0 \n", + " 32 54.3 53.8 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 53.2 \n", + " 1 61.0 \n", + " 2 61.2 \n", + " 3 47.0 \n", + " 4 54.1 \n", + " 5 53.2 \n", + " 6 51.2 \n", + " 7 48.4 \n", + " 8 61.4 \n", + " 9 52.5 \n", + " 10 70.6 \n", + " 11 56.1 \n", + " 12 58.8 \n", + " 13 56.3 \n", + " 14 55.7 \n", + " 15 57.4 \n", + " 16 67.7 \n", + " 17 66.1 \n", + " 18 63.2 \n", + " 19 60.0 \n", + " 20 75.8 \n", + " 21 63.9 \n", + " 22 55.4 \n", + " 23 52.4 \n", + " 24 60.3 \n", + " 25 38.8 \n", + " 26 49.9 \n", + " 27 47.4 \n", + " 28 63.0 \n", + " 29 62.6 \n", + " 30 43.8 \n", + " 31 58.2 \n", + " 32 47.6 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2019': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 44.9 53.3 \n", + " 1 46.8 60.9 \n", + " 2 45.1 61.3 \n", + " 3 42.6 45.2 \n", + " 4 50.1 55.0 \n", + " 5 41.1 48.3 \n", + " 6 30.9 52.9 \n", + " 7 36.9 49.6 \n", + " 8 49.0 59.5 \n", + " 9 24.8 43.4 \n", + " 10 55.1 69.7 \n", + " 11 46.4 59.8 \n", + " 12 35.5 55.8 \n", + " 13 44.7 59.9 \n", + " 14 45.6 62.2 \n", + " 15 21.6 40.5 \n", + " 16 37.6 64.8 \n", + " 17 53.8 70.6 \n", + " 18 51.2 68.4 \n", + " 19 45.0 65.0 \n", + " 20 57.4 75.1 \n", + " 21 53.5 69.5 \n", + " 22 30.7 45.6 \n", + " 23 30.8 53.4 \n", + " 24 60.4 65.9 \n", + " 25 43.9 37.5 \n", + " 26 61.6 51.5 \n", + " 27 20.0 38.7 \n", + " 28 49.1 64.2 \n", + " 29 65.0 66.2 \n", + " 30 27.5 33.9 \n", + " 31 30.2 47.7 \n", + " 32 44.8 50.5 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 51.1 \n", + " 1 59.3 \n", + " 2 59.4 \n", + " 3 44.7 \n", + " 4 50.9 \n", + " 5 51.4 \n", + " 6 48.3 \n", + " 7 46.7 \n", + " 8 62.3 \n", + " 9 47.7 \n", + " 10 68.5 \n", + " 11 51.7 \n", + " 12 56.8 \n", + " 13 54.8 \n", + " 14 55.8 \n", + " 15 52.0 \n", + " 16 66.1 \n", + " 17 64.5 \n", + " 18 65.5 \n", + " 19 59.3 \n", + " 20 74.6 \n", + " 21 63.1 \n", + " 22 50.7 \n", + " 23 50.2 \n", + " 24 59.5 \n", + " 25 36.9 \n", + " 26 45.2 \n", + " 27 43.0 \n", + " 28 59.4 \n", + " 29 59.2 \n", + " 30 43.9 \n", + " 31 56.0 \n", + " 32 45.1 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2020': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 41.7 51.6 \n", + " 1 44.0 58.8 \n", + " 2 40.9 59.3 \n", + " 3 39.3 43.8 \n", + " 4 48.2 53.7 \n", + " 5 38.1 45.4 \n", + " 6 29.2 47.8 \n", + " 7 34.9 47.4 \n", + " 8 45.9 57.8 \n", + " 9 25.2 37.0 \n", + " 10 52.0 68.6 \n", + " 11 41.1 59.7 \n", + " 12 32.2 52.9 \n", + " 13 41.2 58.6 \n", + " 14 39.8 58.2 \n", + " 15 18.4 37.1 \n", + " 16 33.4 62.5 \n", + " 17 50.3 68.4 \n", + " 18 43.5 65.2 \n", + " 19 39.7 61.2 \n", + " 20 53.9 74.8 \n", + " 21 50.6 68.8 \n", + " 22 28.2 44.7 \n", + " 23 27.9 51.2 \n", + " 24 55.4 64.5 \n", + " 25 40.7 35.4 \n", + " 26 61.5 49.7 \n", + " 27 18.7 37.4 \n", + " 28 46.0 63.8 \n", + " 29 61.7 65.3 \n", + " 30 24.5 35.0 \n", + " 31 29.2 42.5 \n", + " 32 39.9 49.1 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 50.3 \n", + " 1 58.5 \n", + " 2 58.5 \n", + " 3 44.2 \n", + " 4 48.8 \n", + " 5 49.4 \n", + " 6 49.1 \n", + " 7 46.7 \n", + " 8 58.6 \n", + " 9 48.3 \n", + " 10 67.6 \n", + " 11 52.2 \n", + " 12 54.8 \n", + " 13 52.4 \n", + " 14 55.8 \n", + " 15 49.2 \n", + " 16 62.7 \n", + " 17 62.1 \n", + " 18 63.7 \n", + " 19 58.8 \n", + " 20 71.3 \n", + " 21 64.9 \n", + " 22 49.6 \n", + " 23 49.4 \n", + " 24 60.4 \n", + " 25 35.7 \n", + " 26 44.3 \n", + " 27 40.0 \n", + " 28 58.0 \n", + " 29 59.3 \n", + " 30 42.7 \n", + " 31 51.9 \n", + " 32 44.3 \n", + " 33 NaN \n", + " 34 NaN ,\n", + " '2021': id_uf nome \\\n", + " 0 0 Brasil \n", + " 1 1 Norte \n", + " 2 2 Nordeste \n", + " 3 3 Sudeste \n", + " 4 4 Sul \n", + " 5 5 Centro-Oeste \n", + " 6 11 Rondônia \n", + " 7 12 Acre \n", + " 8 13 Amazonas \n", + " 9 14 Roraima \n", + " 10 15 Pará \n", + " 11 16 Amapá \n", + " 12 17 Tocantins \n", + " 13 21 Maranhão \n", + " 14 22 Piauí \n", + " 15 23 Ceará \n", + " 16 24 Rio Grande do Norte \n", + " 17 25 Paraíba \n", + " 18 26 Pernambuco \n", + " 19 27 Alagoas \n", + " 20 28 Sergipe \n", + " 21 29 Bahia \n", + " 22 31 Minas Gerais \n", + " 23 32 Espírito Santo \n", + " 24 33 Rio de Janeiro \n", + " 25 35 São Paulo \n", + " 26 41 Paraná \n", + " 27 42 Santa Catarina \n", + " 28 43 Rio Grande do Sul \n", + " 29 50 Mato Grosso do Sul \n", + " 30 51 Mato Grosso \n", + " 31 52 Goiás \n", + " 32 53 Distrito Federal \n", + " 33 NaN NaN \n", + " 34 Notas: Foram consideradas a rede total (escola... NaN \n", + " \n", + " Ensino Fundamental – Anos Iniciais Ensino Fundamental – Anos Finais \\\n", + " 0 36.6 49.5 \n", + " 1 36.8 57.7 \n", + " 2 34.2 56.9 \n", + " 3 36.2 41.1 \n", + " 4 43.1 51.1 \n", + " 5 33.6 43.3 \n", + " 6 23.4 43.6 \n", + " 7 27.9 46.2 \n", + " 8 39.8 56.7 \n", + " 9 20.5 35.8 \n", + " 10 43.4 68.1 \n", + " 11 34.0 58.8 \n", + " 12 27.0 48.7 \n", + " 13 35.3 56.5 \n", + " 14 33.2 56.3 \n", + " 15 14.6 33.3 \n", + " 16 23.6 60.1 \n", + " 17 42.4 65.7 \n", + " 18 36.4 60.8 \n", + " 19 32.2 57.4 \n", + " 20 44.5 72.2 \n", + " 21 42.9 66.6 \n", + " 22 25.0 40.4 \n", + " 23 20.4 47.6 \n", + " 24 49.3 63.4 \n", + " 25 38.8 32.6 \n", + " 26 60.2 46.1 \n", + " 27 14.6 35.1 \n", + " 28 37.6 61.6 \n", + " 29 56.0 63.4 \n", + " 30 21.1 32.3 \n", + " 31 25.2 39.8 \n", + " 32 36.0 48.9 \n", + " 33 NaN NaN \n", + " 34 NaN NaN \n", + " \n", + " Ensino Médio Regular \n", + " 0 48.3 \n", + " 1 57.5 \n", + " 2 57.8 \n", + " 3 41.8 \n", + " 4 44.9 \n", + " 5 46.1 \n", + " 6 48.7 \n", + " 7 44.4 \n", + " 8 55.9 \n", + " 9 43.7 \n", + " 10 66.7 \n", + " 11 54.5 \n", + " 12 52.9 \n", + " 13 50.8 \n", + " 14 55.3 \n", + " 15 44.4 \n", + " 16 59.9 \n", + " 17 61.8 \n", + " 18 61.3 \n", + " 19 58.9 \n", + " 20 68.7 \n", + " 21 68.6 \n", + " 22 45.1 \n", + " 23 47.3 \n", + " 24 57.8 \n", + " 25 34.9 \n", + " 26 40.6 \n", + " 27 37.1 \n", + " 28 53.2 \n", + " 29 57.9 \n", + " 30 40.7 \n", + " 31 46.5 \n", + " 32 43.6 \n", + " 33 NaN \n", + " 34 NaN }" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dfs" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sheet: 2007\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2008\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2009\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2010\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2011\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2012\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2013\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2014\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2015\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2016\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2017\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2018\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2019\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2020\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n", + "Sheet: 2021\n", + "Index(['id_uf', 'nome', 'Ensino Fundamental – Anos Iniciais',\n", + " 'Ensino Fundamental – Anos Finais', 'Ensino Médio Regular'],\n", + " dtype='object')\n", + "\n" + ] + } + ], + "source": [ + "for sheet_name, df in dfs.items():\n", + " print(f\"Sheet: {sheet_name}\")\n", + " print(df.columns) # This will print the column names of each DataFrame\n", + " print() # Adds a blank line for readability" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "melted_dataframe = pd.concat(\n", + " [\n", + " df.pipe(\n", + " lambda d: d.loc[(d[\"id_uf\"].astype(str).str.len() == 2)]\n", + " )\n", + " .pipe(\n", + " lambda d: pd.melt(\n", + " d,\n", + " id_vars=[\"id_uf\", \"nome\"],\n", + " value_vars=d.columns.difference([\"id_uf\", \"nome\"]).tolist(), # Convert to list\n", + " var_name=\"etapa_ensino\",\n", + " value_name=\"tdi\",\n", + " )\n", + " )\n", + " .assign(ano=ano)\n", + " for ano, df in dfs.items()\n", + " ]\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
id_ufnomeetapa_ensinotdiano
011RondôniaEnsino Fundamental – Anos Finais65.82007
112AcreEnsino Fundamental – Anos Finais60.02007
213AmazonasEnsino Fundamental – Anos Finais75.72007
314RoraimaEnsino Fundamental – Anos Finais69.52007
415ParáEnsino Fundamental – Anos Finais68.42007
..................
7643Rio Grande do SulEnsino Médio Regular53.22021
7750Mato Grosso do SulEnsino Médio Regular57.92021
7851Mato GrossoEnsino Médio Regular40.72021
7952GoiásEnsino Médio Regular46.52021
8053Distrito FederalEnsino Médio Regular43.62021
\n", + "

1215 rows × 5 columns

\n", + "
" + ], + "text/plain": [ + " id_uf nome etapa_ensino tdi ano\n", + "0 11 Rondônia Ensino Fundamental – Anos Finais 65.8 2007\n", + "1 12 Acre Ensino Fundamental – Anos Finais 60.0 2007\n", + "2 13 Amazonas Ensino Fundamental – Anos Finais 75.7 2007\n", + "3 14 Roraima Ensino Fundamental – Anos Finais 69.5 2007\n", + "4 15 Pará Ensino Fundamental – Anos Finais 68.4 2007\n", + ".. ... ... ... ... ...\n", + "76 43 Rio Grande do Sul Ensino Médio Regular 53.2 2021\n", + "77 50 Mato Grosso do Sul Ensino Médio Regular 57.9 2021\n", + "78 51 Mato Grosso Ensino Médio Regular 40.7 2021\n", + "79 52 Goiás Ensino Médio Regular 46.5 2021\n", + "80 53 Distrito Federal Ensino Médio Regular 43.6 2021\n", + "\n", + "[1215 rows x 5 columns]" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "melted_dataframe" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([11, 12, 13, 14, 15, 16, 17, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31,\n", + " 32, 33, 35, 41, 42, 43, 50, 51, 52, 53], dtype=object)" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "melted_dataframe['id_uf'].unique()" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "bd_dir = pd.read_csv(\n", + " '/home/vilelaluiza/dados/br_inep_sinopse_estatistica_educacao_basica/input/br_bd_diretorios_brasil.uf.csv'\n", + ")\n", + "\n", + "melted_dataframe[\"nome\"] = (\n", + " melted_dataframe[\"nome\"]\n", + " .astype(str)\n", + " .replace(\n", + " {i[\"nome\"]: i[\"sigla\"] for i in bd_dir.to_dict(\"records\")} # type: ignore\n", + " )\n", + ")\n", + "\n", + "melted_dataframe = melted_dataframe.rename(\n", + " columns={\"nome\": \"sigla_uf\"}, errors=\"raise\"\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [], + "source": [ + "melted_dataframe = melted_dataframe[\n", + " [\n", + " \"ano\",\n", + " \"sigla_uf\",\n", + " \"etapa_ensino\",\n", + " \"tdi\",\n", + " ]\n", + "]" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
anosigla_ufetapa_ensinotdi
02007ROEnsino Fundamental – Anos Finais65.8
12007ACEnsino Fundamental – Anos Finais60.0
22007AMEnsino Fundamental – Anos Finais75.7
32007RREnsino Fundamental – Anos Finais69.5
42007PAEnsino Fundamental – Anos Finais68.4
...............
762021RSEnsino Médio Regular53.2
772021MSEnsino Médio Regular57.9
782021MTEnsino Médio Regular40.7
792021GOEnsino Médio Regular46.5
802021DFEnsino Médio Regular43.6
\n", + "

1215 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " ano sigla_uf etapa_ensino tdi\n", + "0 2007 RO Ensino Fundamental – Anos Finais 65.8\n", + "1 2007 AC Ensino Fundamental – Anos Finais 60.0\n", + "2 2007 AM Ensino Fundamental – Anos Finais 75.7\n", + "3 2007 RR Ensino Fundamental – Anos Finais 69.5\n", + "4 2007 PA Ensino Fundamental – Anos Finais 68.4\n", + ".. ... ... ... ...\n", + "76 2021 RS Ensino Médio Regular 53.2\n", + "77 2021 MS Ensino Médio Regular 57.9\n", + "78 2021 MT Ensino Médio Regular 40.7\n", + "79 2021 GO Ensino Médio Regular 46.5\n", + "80 2021 DF Ensino Médio Regular 43.6\n", + "\n", + "[1215 rows x 4 columns]" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "melted_dataframe" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [], + "source": [ + "path = os.path.join(\n", + " OUTPUT, \"educacao_especial_distorcao_idade_serie\"\n", + " )\n", + "\n", + "os.makedirs(path, exist_ok=True)\n", + "melted_dataframe.astype(str).to_csv(os.path.join(path, \"data.csv\"), index=False)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.9.17" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/models/br_inep_educacao_especial/code/educacao_especial_formacao_docente.ipynb b/models/br_inep_educacao_especial/code/educacao_especial_formacao_docente.ipynb new file mode 100644 index 00000000..6a47fc0b --- /dev/null +++ b/models/br_inep_educacao_especial/code/educacao_especial_formacao_docente.ipynb @@ -0,0 +1,460 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import zipfile\n", + "import pandas as pd\n", + "import basedosdados as bd\n", + "\n", + "INPUT = os.path.join(os.getcwd(), \"input\")\n", + "OUTPUT = os.path.join(os.getcwd(), \"output\")\n", + "\n", + "os.makedirs(INPUT, exist_ok=True)\n", + "os.makedirs(OUTPUT, exist_ok=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "def read_sheet(sheet_name: str, skiprows: int = 9) -> pd.DataFrame:\n", + " return pd.read_excel(\n", + " os.path.join(\n", + " INPUT,\n", + " \"Demanda_23546-049990_2024_06_DOC_EDU_ESPECIAL_BAS__2012_A_2023.xlsx\"\n", + " ),\n", + " skiprows=skiprows,\n", + " sheet_name=sheet_name,\n", + " dtype=str\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "excel_data = pd.ExcelFile(os.path.join(\n", + " INPUT,\n", + " \"Demanda_23546-049990_2024_06_DOC_EDU_ESPECIAL_BAS__2012_A_2023.xlsx\"\n", + " ))\n", + "\n", + "# Get the sheet names\n", + "sheet_names = excel_data.sheet_names" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "dfs = {\n", + " sheet_name: read_sheet(sheet_name)\n", + " for sheet_name in sheet_names\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'Planilha1': NU_ANO_CENSO CO_REGIAO NO_REGIAO \\\n", + " 0 2012 NaN Brasil \n", + " 1 2012 1 Norte \n", + " 2 2012 1 Norte \n", + " 3 2012 1 Norte \n", + " 4 2012 1 Norte \n", + " ... ... ... ... \n", + " 57988 NaN NaN NaN \n", + " 57989 Fonte: INEP – Censo Escolar da Educação Básica NaN NaN \n", + " 57990 Notas: 1 - Os docentes referem-se aos indivíd... NaN NaN \n", + " 57991 2 - Os docentes são contados u... NaN NaN \n", + " 57992 3 - Não inclui auxiliares da E... NaN NaN \n", + " \n", + " CO_UF SG_UF NO_UF CO_MUNICIPIO NO_MUNICIPIO DOCEE DOCFED \\\n", + " 0 NaN NaN NaN NaN NaN 88244 255 \n", + " 1 NaN NaN NaN NaN NaN 5954 41 \n", + " 2 11 RO Rondônia NaN NaN 593 8 \n", + " 3 11 RO Rondônia 1100015 Alta Floresta D'Oeste 12 0 \n", + " 4 11 RO Rondônia 1100403 Alto Paraíso 2 0 \n", + " ... ... ... ... ... ... ... ... \n", + " 57988 NaN NaN NaN NaN NaN NaN NaN \n", + " 57989 NaN NaN NaN NaN NaN NaN NaN \n", + " 57990 NaN NaN NaN NaN NaN NaN NaN \n", + " 57991 NaN NaN NaN NaN NaN NaN NaN \n", + " 57992 NaN NaN NaN NaN NaN NaN NaN \n", + " \n", + " DOCEST DOCMUNI DOCPRIV \n", + " 0 23762 52541 21635 \n", + " 1 2328 3490 739 \n", + " 2 244 243 161 \n", + " 3 2 9 1 \n", + " 4 2 0 0 \n", + " ... ... ... ... \n", + " 57988 NaN NaN NaN \n", + " 57989 NaN NaN NaN \n", + " 57990 NaN NaN NaN \n", + " 57991 NaN NaN NaN \n", + " 57992 NaN NaN NaN \n", + " \n", + " [57993 rows x 13 columns]}" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dfs" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sheet: Planilha1\n", + "Index(['NU_ANO_CENSO', 'CO_REGIAO', 'NO_REGIAO', 'CO_UF', 'SG_UF', 'NO_UF',\n", + " 'CO_MUNICIPIO', 'NO_MUNICIPIO', 'DOCEE', 'DOCFED', 'DOCEST', 'DOCMUNI',\n", + " 'DOCPRIV'],\n", + " dtype='object')\n", + "\n" + ] + } + ], + "source": [ + "for sheet_name, df in dfs.items():\n", + " print(f\"Sheet: {sheet_name}\")\n", + " print(df.columns) # This will print the column names of each DataFrame\n", + " print() # Adds a blank line for readability" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "RENAME_COLUMNS = {\n", + " 'NU_ANO_CENSO':'ano', \n", + " 'SG_UF':'sigla_uf', \n", + " 'CO_MUNICIPIO':'id_municipio', \n", + " 'DOCFED':'Federal', \n", + " 'DOCEST':'Estadual', \n", + " 'DOCMUNI':'Municipal',\n", + " 'DOCPRIV':'Privada' \n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "def drop_unused_columns(df: pd.DataFrame) -> pd.DataFrame:\n", + " cols_drop = [\n", + " col\n", + " for col in df.columns\n", + " if col.startswith(\"NO_\") \n", + " or col.startswith(\"CO_\")\n", + " or col.startswith('DOCEE') \n", + " ]\n", + "\n", + " return df.drop(columns=cols_drop)\n", + "\n", + "dfs = {\n", + " name: drop_unused_columns(\n", + " df.rename(columns=RENAME_COLUMNS, errors=\"raise\")\n", + " )\n", + " for name, df in dfs.items()\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sheet: Planilha1\n", + "Index(['ano', 'sigla_uf', 'id_municipio', 'Federal', 'Estadual', 'Municipal',\n", + " 'Privada'],\n", + " dtype='object')\n", + "\n" + ] + } + ], + "source": [ + "for sheet_name, df in dfs.items():\n", + " print(f\"Sheet: {sheet_name}\")\n", + " print(df.columns) # This will print the column names of each DataFrame\n", + " print() # Adds a blank line for readability" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "melted_dataframe = pd.concat(\n", + " [\n", + " df.pipe(\n", + " lambda d: d.loc[(d[\"id_municipio\"].notna()) & (d[\"id_municipio\"] != \" \")]\n", + " )\n", + " .pipe(\n", + " lambda d: pd.melt(\n", + " d,\n", + " id_vars=[\"ano\", \"sigla_uf\", 'id_municipio'],\n", + " value_vars=d.columns.difference([\"id_uf\", \"nome\"]).tolist(), # Convert to list\n", + " var_name=\"rede\",\n", + " value_name=\"quantidade_docente_formacao_continuada\",\n", + " )\n", + " )\n", + " ]\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "melted_dataframe = melted_dataframe.sort_values(\n", + " by=['ano', 'sigla_uf','id_municipio', 'rede'], \n", + " ascending=[True, True, True, True])" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
anosigla_ufid_municipioredequantidade_docente_formacao_continuada
452012AC1200013Estadual2
576382012AC1200013Federal0
1152312012AC1200013Municipal12
1728242012AC1200013Privada0
462012AC1200104Estadual3
..................
2256132023TO1721307Privada0
528352023TO1722107Estadual0
1104282023TO1722107Federal0
1680212023TO1722107Municipal1
2256142023TO1722107Privada0
\n", + "

230372 rows × 5 columns

\n", + "
" + ], + "text/plain": [ + " ano sigla_uf id_municipio rede \\\n", + "45 2012 AC 1200013 Estadual \n", + "57638 2012 AC 1200013 Federal \n", + "115231 2012 AC 1200013 Municipal \n", + "172824 2012 AC 1200013 Privada \n", + "46 2012 AC 1200104 Estadual \n", + "... ... ... ... ... \n", + "225613 2023 TO 1721307 Privada \n", + "52835 2023 TO 1722107 Estadual \n", + "110428 2023 TO 1722107 Federal \n", + "168021 2023 TO 1722107 Municipal \n", + "225614 2023 TO 1722107 Privada \n", + "\n", + " quantidade_docente_formacao_continuada \n", + "45 2 \n", + "57638 0 \n", + "115231 12 \n", + "172824 0 \n", + "46 3 \n", + "... ... \n", + "225613 0 \n", + "52835 0 \n", + "110428 0 \n", + "168021 1 \n", + "225614 0 \n", + "\n", + "[230372 rows x 5 columns]" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "melted_dataframe" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [], + "source": [ + "path = os.path.join(\n", + " OUTPUT, \"educacao_especial_formacao_docente\"\n", + " )\n", + "\n", + "os.makedirs(path, exist_ok=True)\n", + "melted_dataframe.astype(str).to_csv(os.path.join(path, \"data.csv\"), index=False)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.9.17" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/models/br_inep_educacao_especial/code/educacao_especial_taxa_rendimento.ipynb b/models/br_inep_educacao_especial/code/educacao_especial_taxa_rendimento.ipynb new file mode 100644 index 00000000..cba31907 --- /dev/null +++ b/models/br_inep_educacao_especial/code/educacao_especial_taxa_rendimento.ipynb @@ -0,0 +1,815 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import zipfile\n", + "import pandas as pd\n", + "import basedosdados as bd\n", + "\n", + "INPUT = os.path.join(os.getcwd(), \"input\")\n", + "OUTPUT = os.path.join(os.getcwd(), \"output\")\n", + "\n", + "os.makedirs(INPUT, exist_ok=True)\n", + "os.makedirs(OUTPUT, exist_ok=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": {}, + "outputs": [], + "source": [ + "def read_sheet(sheet_name: str, skiprows: int = 8) -> pd.DataFrame:\n", + " return pd.read_excel(\n", + " os.path.join(\n", + " INPUT,\n", + " \"tx_rend_brasil_regioes_ufs_esp.xlsx\"\n", + " ),\n", + " skiprows=skiprows,\n", + " sheet_name=sheet_name\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": {}, + "outputs": [], + "source": [ + "excel_data = pd.ExcelFile(os.path.join(\n", + " INPUT,\n", + " \"tx_rend_brasil_regioes_ufs_esp.xlsx\"\n", + " ))\n", + "\n", + "# Get the sheet names\n", + "sheet_names = excel_data.sheet_names" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [], + "source": [ + "dfs = {\n", + " sheet_name: read_sheet(sheet_name)\n", + " for sheet_name in sheet_names\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'BRASIL_REGIOES_UFS ': NU_ANO_CENSO UNIDGEO \\\n", + " 0 2007 Brasil \n", + " 1 2007 Norte \n", + " 2 2007 Nordeste \n", + " 3 2007 Sudeste \n", + " 4 2007 Sul \n", + " .. ... ... \n", + " 492 2021 Mato Grosso \n", + " 493 2021 Goiás \n", + " 494 2021 Distrito Federal \n", + " 495 NaN NaN \n", + " 496 Fonte: Censo da Educação Básica 2021/INEP. NaN \n", + " \n", + " NO_CATEGORIA NO_DEPENDENCIA 1_CAT_FUN 1_CAT_FUN_AI 1_CAT_FUN_AF \\\n", + " 0 Total Total 73.1 71.6 78.7 \n", + " 1 Total Total 63.2 61.4 75.5 \n", + " 2 Total Total 67.0 65.7 73.0 \n", + " 3 Total Total 77.0 75.6 81.5 \n", + " 4 Total Total 76.8 76.4 78.1 \n", + " .. ... ... ... ... ... \n", + " 492 Total Total 96.3 96.2 96.4 \n", + " 493 Total Total 96.5 95.2 97.6 \n", + " 494 Total Total 89.1 83.1 95.7 \n", + " 495 NaN NaN NaN NaN NaN \n", + " 496 NaN NaN NaN NaN NaN \n", + " \n", + " 1_CAT_MED 2_CAT_FUN 2_CAT_FUN_AI 2_CAT_FUN_AF 2_CAT_MED 3_CAT_FUN \\\n", + " 0 79.6 22.1 23.8 16.2 13.0 4.8 \n", + " 1 77.5 28.6 30.4 16.6 11.1 8.2 \n", + " 2 77.0 24.7 26.2 17.9 11.3 8.3 \n", + " 3 79.6 19.9 21.4 14.7 14.9 3.1 \n", + " 4 81.4 20.4 21.0 18.3 11.5 2.8 \n", + " .. ... ... ... ... ... ... \n", + " 492 81.9 3.1 3.4 2.7 13.4 0.6 \n", + " 493 97.8 2.8 4.2 1.6 1.3 0.7 \n", + " 494 92.2 10.6 16.4 4.1 7.3 0.3 \n", + " 495 NaN NaN NaN NaN NaN NaN \n", + " 496 NaN NaN NaN NaN NaN NaN \n", + " \n", + " 3_CAT_FUN_AI 3_CAT_FUN_AF 3_CAT_MED \n", + " 0 4.6 5.1 7.4 \n", + " 1 8.2 7.9 11.4 \n", + " 2 8.1 9.1 11.7 \n", + " 3 3.0 3.8 5.5 \n", + " 4 2.6 3.6 7.1 \n", + " .. ... ... ... \n", + " 492 0.4 0.9 4.7 \n", + " 493 0.6 0.8 0.9 \n", + " 494 0.5 0.2 0.5 \n", + " 495 NaN NaN NaN \n", + " 496 NaN NaN NaN \n", + " \n", + " [497 rows x 16 columns]}" + ] + }, + "execution_count": 66, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dfs" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sheet: BRASIL_REGIOES_UFS \n", + "Index(['NU_ANO_CENSO', 'UNIDGEO', 'NO_CATEGORIA', 'NO_DEPENDENCIA',\n", + " '1_CAT_FUN', '1_CAT_FUN_AI', '1_CAT_FUN_AF', '1_CAT_MED', '2_CAT_FUN',\n", + " '2_CAT_FUN_AI', '2_CAT_FUN_AF', '2_CAT_MED', '3_CAT_FUN',\n", + " '3_CAT_FUN_AI', '3_CAT_FUN_AF', '3_CAT_MED'],\n", + " dtype='object')\n", + "\n" + ] + } + ], + "source": [ + "for sheet_name, df in dfs.items():\n", + " print(f\"Sheet: {sheet_name}\")\n", + " print(df.columns) # This will print the column names of each DataFrame\n", + " print() # Adds a blank line for readability\n" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": {}, + "outputs": [], + "source": [ + "RENAME_COLUMNS = {\n", + " 'NU_ANO_CENSO':'ano', \n", + " 'UNIDGEO':'nome_uf',\n", + " '1_CAT_FUN_AI':'taxaaprovacao_anosiniciais', \n", + " '1_CAT_FUN_AF':'taxaaprovacao_anosfinais', \n", + " '1_CAT_MED':'taxaaprovacao_ensinomedio', \n", + " '2_CAT_FUN_AI':'taxareprovacao_anosiniciais', \n", + " '2_CAT_FUN_AF':'taxareprovacao_anosfinais', \n", + " '2_CAT_MED':'taxareprovacao_ensinomedio', \n", + " '3_CAT_FUN_AI':'taxaabandono_anosiniciais', \n", + " '3_CAT_FUN_AF':'taxaabandono_anosfinais', \n", + " '3_CAT_MED' : 'taxaabandono_ensinomedio' \n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [], + "source": [ + "def drop_unused_columns(df: pd.DataFrame) -> pd.DataFrame:\n", + " cols_drop = [\n", + " col\n", + " for col in df.columns\n", + " if col.startswith(\"NO_\") \n", + " or col.startswith(\"1_\") \n", + " or col.startswith(\"2_\") \n", + " or col.startswith(\"3_\")\n", + " ]\n", + "\n", + " return df.drop(columns=cols_drop)\n", + "\n", + "dfs = {\n", + " name: drop_unused_columns(\n", + " df.rename(columns=RENAME_COLUMNS, errors=\"raise\")\n", + " )\n", + " for name, df in dfs.items()\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'BRASIL_REGIOES_UFS ': ano nome_uf \\\n", + " 0 2007 Brasil \n", + " 1 2007 Norte \n", + " 2 2007 Nordeste \n", + " 3 2007 Sudeste \n", + " 4 2007 Sul \n", + " .. ... ... \n", + " 492 2021 Mato Grosso \n", + " 493 2021 Goiás \n", + " 494 2021 Distrito Federal \n", + " 495 NaN NaN \n", + " 496 Fonte: Censo da Educação Básica 2021/INEP. NaN \n", + " \n", + " taxaaprovacao_anosiniciais taxaaprovacao_anosfinais \\\n", + " 0 71.6 78.7 \n", + " 1 61.4 75.5 \n", + " 2 65.7 73.0 \n", + " 3 75.6 81.5 \n", + " 4 76.4 78.1 \n", + " .. ... ... \n", + " 492 96.2 96.4 \n", + " 493 95.2 97.6 \n", + " 494 83.1 95.7 \n", + " 495 NaN NaN \n", + " 496 NaN NaN \n", + " \n", + " taxaaprovacao_ensinomedio taxareprovacao_anosiniciais \\\n", + " 0 79.6 23.8 \n", + " 1 77.5 30.4 \n", + " 2 77.0 26.2 \n", + " 3 79.6 21.4 \n", + " 4 81.4 21.0 \n", + " .. ... ... \n", + " 492 81.9 3.4 \n", + " 493 97.8 4.2 \n", + " 494 92.2 16.4 \n", + " 495 NaN NaN \n", + " 496 NaN NaN \n", + " \n", + " taxareprovacao_anosfinais taxareprovacao_ensinomedio \\\n", + " 0 16.2 13.0 \n", + " 1 16.6 11.1 \n", + " 2 17.9 11.3 \n", + " 3 14.7 14.9 \n", + " 4 18.3 11.5 \n", + " .. ... ... \n", + " 492 2.7 13.4 \n", + " 493 1.6 1.3 \n", + " 494 4.1 7.3 \n", + " 495 NaN NaN \n", + " 496 NaN NaN \n", + " \n", + " taxaabandono_anosiniciais taxaabandono_anosfinais \\\n", + " 0 4.6 5.1 \n", + " 1 8.2 7.9 \n", + " 2 8.1 9.1 \n", + " 3 3.0 3.8 \n", + " 4 2.6 3.6 \n", + " .. ... ... \n", + " 492 0.4 0.9 \n", + " 493 0.6 0.8 \n", + " 494 0.5 0.2 \n", + " 495 NaN NaN \n", + " 496 NaN NaN \n", + " \n", + " taxaabandono_ensinomedio \n", + " 0 7.4 \n", + " 1 11.4 \n", + " 2 11.7 \n", + " 3 5.5 \n", + " 4 7.1 \n", + " .. ... \n", + " 492 4.7 \n", + " 493 0.9 \n", + " 494 0.5 \n", + " 495 NaN \n", + " 496 NaN \n", + " \n", + " [497 rows x 11 columns]}" + ] + }, + "execution_count": 70, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dfs" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Sheet: BRASIL_REGIOES_UFS \n", + "Index(['ano', 'nome_uf', 'taxaaprovacao_anosiniciais',\n", + " 'taxaaprovacao_anosfinais', 'taxaaprovacao_ensinomedio',\n", + " 'taxareprovacao_anosiniciais', 'taxareprovacao_anosfinais',\n", + " 'taxareprovacao_ensinomedio', 'taxaabandono_anosiniciais',\n", + " 'taxaabandono_anosfinais', 'taxaabandono_ensinomedio'],\n", + " dtype='object')\n", + "\n" + ] + } + ], + "source": [ + "for sheet_name, df in dfs.items():\n", + " print(f\"Sheet: {sheet_name}\")\n", + " print(df.columns) # This will print the column names of each DataFrame\n", + " print() # Adds a blank line for readability" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": {}, + "outputs": [], + "source": [ + "melted_dataframe = pd.concat(\n", + " [\n", + " df.pipe(\n", + " lambda d: d.loc[(d[\"nome_uf\"].notna()) & (d[\"nome_uf\"] != \" \")]\n", + " )\n", + " .pipe(\n", + " lambda d: pd.melt(\n", + " d,\n", + " id_vars=[\"ano\", \"nome_uf\"],\n", + " value_vars=d.columns.difference([\"ano\", \"nome_uf\"]).tolist(), # Convert to list\n", + " var_name=\"metrica\",\n", + " value_name=\"valor\",\n", + " )\n", + " )\n", + " ]\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
anonome_ufmetricavalor
02007Brasiltaxaabandono_anosfinais5.1
12007Nortetaxaabandono_anosfinais7.9
22007Nordestetaxaabandono_anosfinais9.1
32007Sudestetaxaabandono_anosfinais3.8
42007Sultaxaabandono_anosfinais3.6
...............
44502021Rio Grande do Sultaxareprovacao_ensinomedio1.5
44512021Mato Grosso do Sultaxareprovacao_ensinomedio8.4
44522021Mato Grossotaxareprovacao_ensinomedio13.4
44532021Goiástaxareprovacao_ensinomedio1.3
44542021Distrito Federaltaxareprovacao_ensinomedio7.3
\n", + "

4455 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " ano nome_uf metrica valor\n", + "0 2007 Brasil taxaabandono_anosfinais 5.1\n", + "1 2007 Norte taxaabandono_anosfinais 7.9\n", + "2 2007 Nordeste taxaabandono_anosfinais 9.1\n", + "3 2007 Sudeste taxaabandono_anosfinais 3.8\n", + "4 2007 Sul taxaabandono_anosfinais 3.6\n", + "... ... ... ... ...\n", + "4450 2021 Rio Grande do Sul taxareprovacao_ensinomedio 1.5\n", + "4451 2021 Mato Grosso do Sul taxareprovacao_ensinomedio 8.4\n", + "4452 2021 Mato Grosso taxareprovacao_ensinomedio 13.4\n", + "4453 2021 Goiás taxareprovacao_ensinomedio 1.3\n", + "4454 2021 Distrito Federal taxareprovacao_ensinomedio 7.3\n", + "\n", + "[4455 rows x 4 columns]" + ] + }, + "execution_count": 73, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "melted_dataframe" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": {}, + "outputs": [], + "source": [ + "melted_dataframe['etapa_ensino'] = melted_dataframe['metrica'].apply(\n", + " lambda v: v.split('_')[-1]) # Extracts 'anosiniciais', 'anosfinais', or 'ensinomedio'\n", + "melted_dataframe['tipo_metrica'] = melted_dataframe['metrica'].apply(\n", + " lambda v: v.split('_')[0]) # Extracts 'taxaaprovacao', 'taxareprovacao', 'taxaabandono'\n", + "\n", + "# Pivoting the melted DataFrame to get desired columns\n", + "df_final = melted_dataframe.pivot_table(index=['ano', 'nome_uf', 'etapa_ensino'], \n", + " columns='tipo_metrica', \n", + " values='valor').reset_index()" + ] + }, + { + "cell_type": "code", + "execution_count": 75, + "metadata": {}, + "outputs": [], + "source": [ + "RENAME_COLUMNS_MELTED = {\n", + " 'taxaabandono':'taxa_abandono', \n", + " 'taxaaprovacao':'taxa_aprovacao',\n", + " 'taxareprovacao':'taxa_reprovacao' \n", + "}\n", + "\n", + "etapa_ensino = {\n", + " 'anosiniciais': 'Ensino Fundamental – Anos Iniciais',\n", + " 'anosfinais':'Ensino Fundamental – Anos Finais',\n", + " 'ensinomedio':'Ensino Médio Regular'\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
tipo_metricaanonome_ufetapa_ensinotaxaabandonotaxaaprovacaotaxareprovacao
02007Acreanosfinais0.091.98.1
12007Acreanosiniciais4.870.524.7
22007Acreensinomedio6.184.89.1
32007Alagoasanosfinais16.364.818.9
42007Alagoasanosiniciais9.062.228.8
.....................
14802021São Pauloanosiniciais0.569.829.7
14812021São Pauloensinomedio3.694.32.1
14822021Tocantinsanosfinais1.296.22.6
14832021Tocantinsanosiniciais0.488.411.2
14842021Tocantinsensinomedio2.595.22.3
\n", + "

1485 rows × 6 columns

\n", + "
" + ], + "text/plain": [ + "tipo_metrica ano nome_uf etapa_ensino taxaabandono taxaaprovacao \\\n", + "0 2007 Acre anosfinais 0.0 91.9 \n", + "1 2007 Acre anosiniciais 4.8 70.5 \n", + "2 2007 Acre ensinomedio 6.1 84.8 \n", + "3 2007 Alagoas anosfinais 16.3 64.8 \n", + "4 2007 Alagoas anosiniciais 9.0 62.2 \n", + "... ... ... ... ... ... \n", + "1480 2021 São Paulo anosiniciais 0.5 69.8 \n", + "1481 2021 São Paulo ensinomedio 3.6 94.3 \n", + "1482 2021 Tocantins anosfinais 1.2 96.2 \n", + "1483 2021 Tocantins anosiniciais 0.4 88.4 \n", + "1484 2021 Tocantins ensinomedio 2.5 95.2 \n", + "\n", + "tipo_metrica taxareprovacao \n", + "0 8.1 \n", + "1 24.7 \n", + "2 9.1 \n", + "3 18.9 \n", + "4 28.8 \n", + "... ... \n", + "1480 29.7 \n", + "1481 2.1 \n", + "1482 2.6 \n", + "1483 11.2 \n", + "1484 2.3 \n", + "\n", + "[1485 rows x 6 columns]" + ] + }, + "execution_count": 76, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df_final" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "metadata": {}, + "outputs": [], + "source": [ + "df_final = df_final.rename(columns=RENAME_COLUMNS_MELTED)\n", + "df_final['etapa_ensino'] = df_final['etapa_ensino'].replace(etapa_ensino)" + ] + }, + { + "cell_type": "code", + "execution_count": 78, + "metadata": {}, + "outputs": [], + "source": [ + "bd_dir = pd.read_csv(\n", + " '/home/vilelaluiza/dados/br_inep_sinopse_estatistica_educacao_basica/input/br_bd_diretorios_brasil.uf.csv'\n", + ")\n", + "\n", + "# Perform an inner merge based on 'nome_uf' and 'nome'\n", + "df_final = pd.merge(df_final, bd_dir[['nome', 'sigla']], how='inner', left_on='nome_uf', right_on='nome')\n", + "\n", + "# Rename the 'sigla' column to 'sigla_uf' and drop the 'nome' column\n", + "df_final = df_final.rename(columns={'sigla': 'sigla_uf'}).drop(columns=['nome_uf','nome'])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 81, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array(['AC', 'AL', 'AP', 'AM', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MT',\n", + " 'MS', 'MG', 'PR', 'PB', 'PA', 'PE', 'PI', 'RN', 'RS', 'RJ', 'RO',\n", + " 'RR', 'SC', 'SE', 'SP', 'TO'], dtype=object)" + ] + }, + "execution_count": 81, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df_final['sigla_uf'].unique()" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [], + "source": [ + "df_final = df_final[['ano', 'sigla_uf', 'etapa_ensino', 'taxa_aprovacao','taxa_reprovacao','taxa_abandono']]" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": {}, + "outputs": [], + "source": [ + "path = os.path.join(\n", + " OUTPUT, \"educacao_especial_taxa_rendimento\"\n", + " )\n", + "\n", + "os.makedirs(path, exist_ok=True)\n", + "df_final.astype(str).to_csv(os.path.join(path, \"data.csv\"), index=False)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.9.17" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/models/br_inep_educacao_especial/schema.yml b/models/br_inep_educacao_especial/schema.yml new file mode 100644 index 00000000..7ad48021 --- /dev/null +++ b/models/br_inep_educacao_especial/schema.yml @@ -0,0 +1,339 @@ +--- +version: 2 +models: + - name: br_inep_educacao_especial__etapa_ensino + description: Número de alunos matriculados na Educação Especial ao longo do tempo + por tipo de classe (Comuns ou Exclusivas) e Etapa de Ensino + tests: + - not_null_proportion_multiple_columns: + at_least: 0.05 + columns: + - name: ano + description: Ano + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: sigla_uf + description: Sigla da Unidade da Federação + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__uf') + field: sigla + - name: id_municipio + description: ID Município - IBGE 7 Dígitos + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__municipio') + field: id_municipio + - name: tipo_classe + description: Tipo de classe da Educação Especial (e.g. Classes Comuns ou Classes + Exclusivas/Especiais) + - name: etapa_ensino + description: Etapa e/ou Sub-etapas de ensino (e.g. Creche, Pré-escola, Anos + Iniciais, Anos Finais, Ensino Fundamental - EJA, ...) + - name: quantidade_matricula + description: Número de matrículas + - name: br_inep_educacao_especial__faixa_etaria + description: Número de alunos matriculados na Educação Especial ao longo do tempo + por tipo de classe (Comuns ou Exclusivas) e faixa etária + tests: + - not_null_proportion_multiple_columns: + at_least: 0.05 + columns: + - name: ano + description: Ano + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: sigla_uf + description: Sigla da Unidade da Federação + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__uf') + field: sigla + - name: id_municipio + description: ID Município - IBGE 7 Dígitos + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__municipio') + field: id_municipio + - name: tipo_classe + description: Tipo de classe da Educação Especial (e.g. Classes Comuns ou Classes + Exclusivas/Especiais) + - name: faixa_etaria + description: Faixa etária + - name: quantidade_matricula + description: Número de matrículas + - name: br_inep_educacao_especial__localizacao + description: Número de alunos matriculados na Educação Especial ao longo do tempo + por tipo de classe, rede e localização + tests: + - not_null_proportion_multiple_columns: + at_least: 0.05 + columns: + - name: ano + description: Ano + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: sigla_uf + description: Sigla da Unidade da Federação + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__uf') + field: sigla + - name: id_municipio + description: ID Município - IBGE 7 Dígitos + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__municipio') + field: id_municipio + - name: tipo_classe + description: Tipo de classe da Educação Especial (e.g. Classes Comuns ou Classes + Exclusivas/Especiais) + - name: rede + description: Rede Escolar (e.g. Federal, Estadual, Municipal e Privada) + - name: localizacao + description: Localização (e.g. Zona Urbana, Zona Rural) + - name: quantidade_matricula + description: Número de matrículas + - name: br_inep_educacao_especial__sexo_raca_cor + description: Número de alunos matriculados na Educação Especial ao longo do tempo + por tipo de classe, sexo e raça/cor + tests: + - not_null_proportion_multiple_columns: + at_least: 0.05 + columns: + - name: ano + description: Ano + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: sigla_uf + description: Sigla da Unidade da Federação + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__uf') + field: sigla + - name: id_municipio + description: ID Município - IBGE 7 Dígitos + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__municipio') + field: id_municipio + - name: tipo_classe + description: Tipo de classe da Educação Especial (e.g. Classes Comuns ou Classes + Exclusivas/Especiais) + - name: sexo + description: Sexo + - name: raca_cor + description: Raça/Cor + - name: quantidade_matricula + description: Número de matrículas + - name: br_inep_educacao_especial__tempo_ensino + description: Número de alunos matriculados na Educação Especial ao longo do tempo + por tipo de classe, rede e tempo de ensino (Integral ou Parcial) + tests: + - not_null_proportion_multiple_columns: + at_least: 0.05 + columns: + - name: ano + description: Ano + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: sigla_uf + description: Sigla da Unidade da Federação + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__uf') + field: sigla + - name: id_municipio + description: ID Município - IBGE 7 Dígitos + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__municipio') + field: id_municipio + - name: tipo_classe + description: Tipo de classe da Educação Especial (e.g. Classes Comuns ou Classes + Exclusivas/Especiais) + - name: rede + description: Rede Escolar (e.g. Federal, Estadual, Municipal e Privada) + - name: tempo_ensino + description: Classificação em tempo integral e tempo parcial + - name: quantidade_matricula + description: Número de matrículas + - name: br_inep_educacao_especial__tipo_deficiencia + description: Número de alunos matriculados na Educação Especial ao longo do tempo + por tipo de classe e tipo de deficiência, transtorno global do desenvolvimento + ou altas habilidades/superdotação + tests: + - not_null_proportion_multiple_columns: + at_least: 0.05 + columns: + - name: ano + description: Ano + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: sigla_uf + description: Sigla da Unidade da Federação + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__uf') + field: sigla + - name: id_municipio + description: ID Município - IBGE 7 Dígitos + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__municipio') + field: id_municipio + - name: tipo_classe + description: Tipo de classe da Educação Especial (e.g. Classes Comuns ou Classes + Exclusivas/Especiais) + - name: tipo_deficiêcia + description: Tipo de deficiência, transtorno global do desenvolvimento ou + altas habilidades/superdotação + - name: quantidade_matricula + description: Número de matrículas + - name: br_inep_educacao_especial__distorcao_idade_serie + description: 'Taxa de distorção idade-série da Educação Especial. Dados obtidos + via Pedido LAI (nº protocolo: 23546066150202238)' + tests: + - not_null_proportion_multiple_columns: + at_least: 0.05 + columns: + - name: ano + description: Ano + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: sigla_uf + description: Sigla da Unidade da Federação + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__uf') + field: sigla + - name: etapa_ensino + description: Etapa e/ou Sub-etapas de ensino (e.g. Creche, Pré-escola, Anos + Iniciais, Anos Finais, Ensino Fundamental - EJA, ...) + - name: tdi + description: Taxa de distorção idade-série + - name: br_inep_educacao_especial__taxa_rendimento + description: 'Taxas de rendimento (aprovação, reprovação e abandono) da Educação + Especial. Dados obtidos via Pedido LAI (nº protocolo: 23546054413202266)' + columns: + - name: ano + description: Ano + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: sigla_uf + description: Sigla da Unidade da Federação + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__uf') + field: sigla + - name: etapa_ensino + description: Etapa e/ou Sub-etapas de ensino (e.g. Creche, Pré-escola, Anos + Iniciais, Anos Finais, Ensino Fundamental - EJA, ...) + - name: taxa_aprovacao + description: Taxa de aprovação + - name: taxa_reprovacao + description: Taxa de reprovação + - name: taxa_abandono + description: Taxa de abandono + - name: br_inep_educacao_especial__docente_aee + description: 'Quantidade de docentes regentes e do Atendimento Educacional Especializado + (AEE) no total e com Formação Continuada em Educação Especial. Dados obtidos + via Pedido LAI (nº protocolo: 23546035869202316)' + columns: + - name: ano + description: Ano + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: sigla_uf + description: Sigla da Unidade da Federação + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__uf') + field: sigla + - name: id_municipio + description: ID Município - IBGE 7 Dígitos + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__municipio') + field: id_municipio + - name: quantidade_docente_regente + description: Número de professores regentes + - name: quantidade_docente_aee + description: Número de professores do Atendimento Educacional Especializado + (AEE) + - name: quantidade_docente_regente_formacao_continuada + description: Número de professores regentes com formação continuada sobre + Educação Especial + - name: quantidade_docente_aee_formacao_continuada + description: Número de professores do Atendimento Educacional Especializado + (AEE) com formação continuada sobre Educação Especial + - name: br_inep_educacao_especial__docente_formacao + description: 'Quantidade de docentes da Educação Básica Formação Continuada em + Educação Especial por rede de ensino. Dados obtidos via Pedido LAI (nº protocolo: + 23546049990202406)' + columns: + - name: ano + description: Ano + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: sigla_uf + description: Sigla da Unidade da Federação + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__uf') + field: sigla + - name: id_municipio + description: ID Município - IBGE 7 Dígitos + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__municipio') + field: id_municipio + - name: rede + description: Rede Escolar (e.g. Federal, Estadual, Municipal e Privada) + - name: quantidade_docente_formacao_continuada + description: Quantidade de docentes da Educação Básica com formação continuada + em Educação Especial + - name: br_inep_educacao_especial__matricula_aee + description: 'Quantidade de matrículas no Atendimento Educacional Especializado + (AEE) por unidade da federação e rede de ensino. Dados obtidos via Pedido LAI + (nº protocolo: 23546086048202330)' + columns: + - name: ano + description: Ano + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: sigla_uf + description: Sigla da Unidade da Federação + tests: + - relationships: + to: ref('br_bd_diretorios_brasil__uf') + field: sigla + - name: rede + description: Rede Escolar (e.g. Federal, Estadual, Municipal e Privada) + - name: quantidade_matricula + description: Número de matrículas na Educação Especial + - name: quantidade_matricula_aee + description: Número de matrículas no Atendimento Educacional Especializado + (AEE) diff --git a/models/br_inep_sinopse_estatistica_educacao_basica/schema.yml b/models/br_inep_sinopse_estatistica_educacao_basica/schema.yml index 253a0460..9678cac1 100644 --- a/models/br_inep_sinopse_estatistica_educacao_basica/schema.yml +++ b/models/br_inep_sinopse_estatistica_educacao_basica/schema.yml @@ -165,204 +165,3 @@ models: description: Raça/Cor - name: quantidade_matricula description: Número de matrículas - - name: br_inep_sinopse_estatistica_educacao_basica__educacao_especial_etapa_ensino - description: Número de alunos matriculados na Educação Especial ao longo do tempo - por tipo de classe (Comuns ou Exclusivas) e Etapa de Ensino - tests: - - not_null_proportion_multiple_columns: - at_least: 0.05 - columns: - - name: ano - description: Ano - tests: - - relationships: - to: ref('br_bd_diretorios_data_tempo__ano') - field: ano.ano - - name: sigla_uf - description: Sigla da Unidade da Federação - tests: - - relationships: - to: ref('br_bd_diretorios_brasil__uf') - field: sigla - - name: id_municipio - description: ID Município - IBGE 7 Dígitos - tests: - - relationships: - to: ref('br_bd_diretorios_brasil__municipio') - field: id_municipio - - name: tipo_classe - description: Tipo de classe da Educação Especial (e.g. Classes Comuns ou Classes - Exclusivas/Especiais) - - name: etapa_ensino - description: Etapa e/ou Sub-etapas de ensino (e.g. Creche, Pré-escola, Anos - Iniciais, Anos Finais, Ensino Fundamental - EJA, ...) - - name: quantidade_matricula - description: Número de matrículas - - name: br_inep_sinopse_estatistica_educacao_basica__educacao_especial_faixa_etaria - description: Número de alunos matriculados na Educação Especial ao longo do tempo - por tipo de classe (Comuns ou Exclusivas) e faixa etária - tests: - - not_null_proportion_multiple_columns: - at_least: 0.05 - columns: - - name: ano - description: Ano - tests: - - relationships: - to: ref('br_bd_diretorios_data_tempo__ano') - field: ano.ano - - name: sigla_uf - description: Sigla da Unidade da Federação - tests: - - relationships: - to: ref('br_bd_diretorios_brasil__uf') - field: sigla - - name: id_municipio - description: ID Município - IBGE 7 Dígitos - tests: - - relationships: - to: ref('br_bd_diretorios_brasil__municipio') - field: id_municipio - - name: tipo_classe - description: Tipo de classe da Educação Especial (e.g. Classes Comuns ou Classes - Exclusivas/Especiais) - - name: faixa_etaria - description: Faixa etária - - name: quantidade_matricula - description: Número de matrículas - - name: br_inep_sinopse_estatistica_educacao_basica__educacao_especial_localizacao - description: Número de alunos matriculados na Educação Especial ao longo do tempo - por tipo de classe, rede e localização - tests: - - not_null_proportion_multiple_columns: - at_least: 0.05 - columns: - - name: ano - description: Ano - tests: - - relationships: - to: ref('br_bd_diretorios_data_tempo__ano') - field: ano.ano - - name: sigla_uf - description: Sigla da Unidade da Federação - tests: - - relationships: - to: ref('br_bd_diretorios_brasil__uf') - field: sigla - - name: id_municipio - description: ID Município - IBGE 7 Dígitos - tests: - - relationships: - to: ref('br_bd_diretorios_brasil__municipio') - field: id_municipio - - name: tipo_classe - description: Tipo de classe da Educação Especial (e.g. Classes Comuns ou Classes - Exclusivas/Especiais) - - name: rede - description: Rede Escolar (e.g. Federal, Estadual, Municipal e Privada) - - name: localizacao - description: Localização (e.g. Zona Urbana, Zona Rural) - - name: quantidade_matricula - description: Número de matrículas - - name: br_inep_sinopse_estatistica_educacao_basica__educacao_especial_sexo_raca_cor - description: Número de alunos matriculados na Educação Especial ao longo do tempo - por tipo de classe, sexo e raça/cor - tests: - - not_null_proportion_multiple_columns: - at_least: 0.05 - columns: - - name: ano - description: Ano - tests: - - relationships: - to: ref('br_bd_diretorios_data_tempo__ano') - field: ano.ano - - name: sigla_uf - description: Sigla da Unidade da Federação - tests: - - relationships: - to: ref('br_bd_diretorios_brasil__uf') - field: sigla - - name: id_municipio - description: ID Município - IBGE 7 Dígitos - tests: - - relationships: - to: ref('br_bd_diretorios_brasil__municipio') - field: id_municipio - - name: tipo_classe - description: Tipo de classe da Educação Especial (e.g. Classes Comuns ou Classes - Exclusivas/Especiais) - - name: sexo - description: Sexo - - name: raca_cor - description: Raça/Cor - - name: quantidade_matricula - description: Número de matrículas - - name: br_inep_sinopse_estatistica_educacao_basica__educacao_especial_tempo_ensino - description: Número de alunos matriculados na Educação Especial ao longo do tempo - por tipo de classe, rede e tempo de ensino (Integral ou Parcial) - tests: - - not_null_proportion_multiple_columns: - at_least: 0.05 - columns: - - name: ano - description: Ano - tests: - - relationships: - to: ref('br_bd_diretorios_data_tempo__ano') - field: ano.ano - - name: sigla_uf - description: Sigla da Unidade da Federação - tests: - - relationships: - to: ref('br_bd_diretorios_brasil__uf') - field: sigla - - name: id_municipio - description: ID Município - IBGE 7 Dígitos - tests: - - relationships: - to: ref('br_bd_diretorios_brasil__municipio') - field: id_municipio - - name: tipo_classe - description: Tipo de classe da Educação Especial (e.g. Classes Comuns ou Classes - Exclusivas/Especiais) - - name: rede - description: Rede Escolar (e.g. Federal, Estadual, Municipal e Privada) - - name: tempo_ensino - description: Classificação em tempo integral e tempo parcial - - name: quantidade_matricula - description: Número de matrículas - - name: br_inep_sinopse_estatistica_educacao_basica__educacao_especial_tipo_deficiencia - description: Número de alunos matriculados na Educação Especial ao longo do tempo - por tipo de classe e tipo de deficiência, transtorno global do desenvolvimento - ou altas habilidades/superdotação - tests: - - not_null_proportion_multiple_columns: - at_least: 0.05 - columns: - - name: ano - description: Ano - tests: - - relationships: - to: ref('br_bd_diretorios_data_tempo__ano') - field: ano.ano - - name: sigla_uf - description: Sigla da Unidade da Federação - tests: - - relationships: - to: ref('br_bd_diretorios_brasil__uf') - field: sigla - - name: id_municipio - description: ID Município - IBGE 7 Dígitos - tests: - - relationships: - to: ref('br_bd_diretorios_brasil__municipio') - field: id_municipio - - name: tipo_classe - description: Tipo de classe da Educação Especial (e.g. Classes Comuns ou Classes - Exclusivas/Especiais) - - name: tipo_deficiêcia - description: Tipo de deficiência, transtorno global do desenvolvimento ou - altas habilidades/superdotação - - name: quantidade_matricula - description: Número de matrículas