Commit fca0dba9 authored by Bruno Meyer's avatar Bruno Meyer 😢
Browse files

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

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

Closes #131

See merge request !29
parents 694bf15e e27cbaf9
Pipeline #17692 passed with stage
in 14 seconds
"""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