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

indice_aprovacao_semestral

parent e1bbb12f
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,32 @@ def average_ira(d):
ch_total = np.sum(temp['CH_TOTAL']) * 100
print(aux/ch_total)
def indice_aprovacao_semestral(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])
if not(ano+"/"+semestre in students[matr]):
students[matr][ano+"/"+semestre] = [0,0]
if(situacao in Situation.SITUATION_PASS):
students[matr][ano+"/"+semestre][0]+=1
students[matr][ano+"/"+semestre][1]+=1
if(situacao in Situation.SITUATION_FAIL):
students[matr][ano+"/"+semestre][1]+=1
print(students)
def aluno_turmas(df):
students = {}
df = df.dropna(subset=['MEDIA_FINAL'])
......@@ -38,26 +64,3 @@ def aluno_turmas(df):
"situacao": situacao
})
print(students)
#~ lines = (df[["MATR_ALUNO","ANO","COD_ATIV_CURRIC","NOME_ATIV_CURRIC","MEDIA_FINAL","PERIODO","SITUACAO"]])
#~ for st in (df.groupby("MATR_ALUNO")):
#~ print(st[1]["MATR_ALUNO"])
#~ print(st[1]["ANO"])
#~ print(st[1]["COD_ATIV_CURRIC"])
#~ print(st[1]["NOME_ATIV_CURRIC"])
#~ print(st[1]["MEDIA_FINAL"])
#~ print(st[1]["PERIODO"])
#~ print(st[1]["SITUACAO"])
#~ print("")
#~ total_student = df['MATR_ALUNO'].drop_duplicates()
#~ for st in total_student:
#~ students[st] = []
#~ hist = df[df["MATR_ALUNO"]==st]
#~ for matr in hist:
#~ print(hist["ANO"])
#~ print(hist[matr]["COD_ATIV_CURRIC"])
#~ print(hist[matr]["NOME_ATIV_CURRIC"])
#~ print(hist[matr]["MEDIA_FINAL"])
#~ print(hist[matr]["PERIODO"])
#~ print(hist[matr]["SITUACAO"])
#~ print(hist[matr])
#~ print("")
......@@ -37,7 +37,8 @@ def generate_degree_data(path, dataframe):
pass
def generate_student_data(path,dataframe):
aluno_turmas(dataframe)
#~ aluno_turmas(dataframe)
indice_aprovacao_semestral(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