Skip to content
Snippets Groups Projects
Commit 60baa649 authored by Bruno Meyer's avatar Bruno Meyer
Browse files

ira_por_quantidade_disciplinas

parent 68a704b8
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,36 @@ def average_ira(d):
ch_total = np.sum(temp['CH_TOTAL']) * 100
print(aux/ch_total)
def ira_por_quantidade_disciplinas(df):
students = {}
df = df.dropna(subset=['MEDIA_FINAL'])
total_students = len(df["MATR_ALUNO"])
for i in range(total_students):
matr = (df["MATR_ALUNO"][i])
if(not (matr in students)):
students[matr] = {}
ano = str(df["ANO"][i])
semestre = str(df["PERIODO"][i])
situacao = int(df["SITUACAO"][i])
nota = float(df["MEDIA_FINAL"][i])
if(situacao in Situation.SITUATION_AFFECT_IRA):
if not(ano+"/"+semestre in students[matr]):
students[matr][ano+"/"+semestre] = [0,0]
students[matr][ano+"/"+semestre][0]+=nota
students[matr][ano+"/"+semestre][1]+=1
for matr in students:
for periodo in students[matr]:
if(students[matr][periodo][1] != 0):
students[matr][periodo][0]/=students[matr][periodo][1]*100
print(students)
def indice_aprovacao_semestral(df):
students = {}
df = df.dropna(subset=['MEDIA_FINAL'])
......
......@@ -38,7 +38,8 @@ def generate_degree_data(path, dataframe):
def generate_student_data(path,dataframe):
#~ aluno_turmas(dataframe)
indice_aprovacao_semestral(dataframe)
#~ indice_aprovacao_semestral(dataframe)
ira_por_quantidade_disciplinas(dataframe)
pass
def generate_student_list(path):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment