Commit c45dfeb4 authored by Bruno Meyer's avatar Bruno Meyer 😢

Merge branch '131-3-reprovacoes-na-disciplina' into 'development'

Resolve "3 reprovações na disciplina" - CEPE9615

Closes #131

See merge request adega/adega!29
parents 641d3c2a 36d8190d
"""This resolution from CEPE deals with the cases where studants might have
their academic record canceled."""
import numpy as np
import pandas as pd
from script.utils.situations import *
def student_three_fails_subject(df):
df = df[df['SITUACAO'].isin(Situation.SITUATION_FAIL)]
df = df[(df['FORMA_EVASAO'] == EvasionForm.EF_ATIVO)]
students = df.groupby(["NOME_PESSOA", "MATR_ALUNO"])
names = {}
for student in students:
subjects = student[1].groupby("COD_ATIV_CURRIC")
for subject in subjects:
if subject[1].shape[0] >= 3:
names[student[0][0]] = student[0][1]
break
return names
......@@ -4,6 +4,7 @@ from script.analysis.degree_analysis import *
from script.analysis.student_analysis import *
from script.analysis.course_analysis import *
from script.analysis.admission_analysis import *
from script.analysis.others_analysis import *
from collections import defaultdict
......@@ -23,6 +24,8 @@ def build_cache(dataframe,path):
generate_student_data(path+'students/',df)
generate_admission_data(path+'admission/',df)
generate_course_data(path+'disciplina/' ,dataframe)
generate_others_data(path+'/others/',df)
def generate_degree_data(path, dataframe):
ensure_path_exists(path)
......@@ -170,4 +173,8 @@ def generate_course_data(path,df):
disciplinas = listagem_disciplina(df,lista_disciplinas)
save_json(path+'disciplinas.json',disciplinas)
def generate_others_data(path, df):
others_dict = {}
others_dict["alunos_reprovacoes_na_mesma_disciplina"] = student_three_fails_subject(df)
save_json(path+"cepe9615.json", others_dict)
\ No newline at end of file
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