Commit 4a615b20 authored by João Denis Rodrigues's avatar João Denis Rodrigues
Browse files

Merge historico e matricula + drop coluna nao utilizada

parent 5c2403e0
......@@ -33,6 +33,20 @@ def read_csv(path):
def fix_dataframes(dataframes):
for df in dataframes:
fix_situation(df['dataframe'])
fix_admission(df['dataframe'])
fix_evasion(df['dataframe'])
if df['name'] == 'historico.xls':
hist = df['dataframe']
if df['name'] == 'matricula.xls':
mat = df['dataframe']
merged = pd.merge(hist, mat, on=['MATR_ALUNO'])
merged.drop(['ID_PESSOA', 'ID_CURRIC_ALUNO', 'CONCEITO', 'NOME_UNIDADE',
'ID_NOTA', 'ID_VERSAO_CURSO', 'NOME_PESSOA', 'SIGLA',
'NUM_VERSAO_y', 'COD_CURSO_y', 'DT_NASCIMENTO'
], axis=1, inplace=True)
merged.rename(columns={'NUM_VERSAO_x':'NUM_VERSAO',
'COD_CURSO_x':'COD_CURSO'}, inplace=True)
print(list(merged))
def fix_situation(df):
if hasattr(df, 'SITUACAO'):
......@@ -41,3 +55,11 @@ def fix_situation(df):
if situation[1] == 'Outro':
temp = df[~df['SITUACAO'].astype(str).str.isdigit()]
df.loc[~df.SITUACAO.astype(str).str.isdigit()] = situation[0]
def fix_admission(df):
pass
def fix_evasion(df):
pass
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment