Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
adega
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Odair M.
adega
Commits
efceac46
Commit
efceac46
authored
7 years ago
by
Bruno Meyer
Browse files
Options
Downloads
Plain Diff
Merge branch 'students' into upload
parents
43479530
be97363c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
script/analysis/admission_analysis.py
+0
-124
0 additions, 124 deletions
script/analysis/admission_analysis.py
script/analysis/student_analysis.py
+10
-7
10 additions, 7 deletions
script/analysis/student_analysis.py
with
10 additions
and
131 deletions
script/analysis/admission_analysis.py
+
0
−
124
View file @
efceac46
...
@@ -12,127 +12,3 @@ def listagem_turma_ingresso(df):
...
@@ -12,127 +12,3 @@ def listagem_turma_ingresso(df):
print
(
t
)
print
(
t
)
print
(
"
\n\n
"
)
print
(
"
\n\n
"
)
print
(
df
[
"
FORMA_INGRESSO
"
][
grupos
[
t
]].
drop_duplicates
())
print
(
df
[
"
FORMA_INGRESSO
"
][
grupos
[
t
]].
drop_duplicates
())
def
listagem_alunos_ativos
(
df
):
return
list
(
df
[
"
MATR_ALUNO
"
][
df
[
"
FORMA_EVASAO
"
]
==
EvasionForm
.
EF_ATIVO
].
drop_duplicates
())
def
posicao_turmaIngresso_semestral
(
df
):
iras
=
ira_semestral
(
df
)
iraMax
=
{}
for
matr
in
iras
:
for
semestreAno
in
iras
[
matr
]:
if
not
(
semestreAno
in
iraMax
):
iraMax
[
semestreAno
]
=
iras
[
matr
][
semestreAno
]
else
:
if
(
iras
[
matr
][
semestreAno
]
>
iraMax
[
semestreAno
]):
iraMax
[
semestreAno
]
=
iras
[
matr
][
semestreAno
]
for
matr
in
iras
:
for
semestreAno
in
iras
[
matr
]:
iras
[
matr
][
semestreAno
]
/=
iraMax
[
semestreAno
]
return
iras
def
periodo_real
(
df
):
aux
=
df
.
groupby
([
"
MATR_ALUNO
"
])
students
=
{}
for
x
in
aux
:
students
[
x
[
0
]]
=
None
return
students
def
periodo_pretendido
(
df
):
aux
=
df
.
groupby
([
"
MATR_ALUNO
"
,
"
ANO_INGRESSO
"
,
"
SEMESTRE_INGRESSO
"
])
students
=
{}
for
x
in
aux
:
students
[
x
[
0
][
0
]]
=
(
ANO_ATUAL
-
int
(
x
[
0
][
1
]))
*
2
+
SEMESTRE_ATUAL
-
int
(
x
[
0
][
2
])
+
1
return
students
def
ira_semestral
(
df
):
aux
=
ira_por_quantidade_disciplinas
(
df
)
for
matr
in
aux
:
for
periodo
in
aux
[
matr
]:
aux
[
matr
][
periodo
]
=
aux
[
matr
][
periodo
][
0
]
return
aux
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
(
int
(
df
[
"
ANO
"
][
i
]))
semestre
=
str
(
df
[
"
PERIODO
"
][
i
])
situacao
=
int
(
df
[
"
SITUACAO
"
][
i
])
nota
=
float
(
df
[
"
MEDIA_FINAL
"
][
i
])
media_credito
=
int
(
df
[
"
MEDIA_CREDITO
"
][
i
])
if
(
situacao
in
Situation
.
SITUATION_AFFECT_IRA
and
media_credito
!=
0
):
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
return
(
students
)
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
(
int
(
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
return
(
students
)
def
aluno_turmas
(
df
):
students
=
{}
df
=
df
.
dropna
(
subset
=
[
'
MEDIA_FINAL
'
])
situations
=
dict
(
Situation
.
SITUATIONS
)
for
matr
,
hist
in
df
.
groupby
(
'
MATR_ALUNO
'
):
students
[
matr
]
=
[]
for
_
,
row
in
hist
.
iterrows
():
data
=
{
'
ano
'
:
str
(
int
(
row
[
"
ANO
"
])),
'
codigo
'
:
row
[
"
COD_ATIV_CURRIC
"
],
'
nome
'
:
row
[
"
NOME_ATIV_CURRIC
"
],
'
nota
'
:
row
[
"
MEDIA_FINAL
"
],
'
semestre
'
:
row
[
"
PERIODO
"
],
'
situacao
'
:
situations
.
get
(
row
[
"
SITUACAO
"
],
Situation
.
SIT_OUTROS
)
}
students
[
matr
].
append
(
data
)
return
students
This diff is collapsed.
Click to expand it.
script/analysis/student_analysis.py
+
10
−
7
View file @
efceac46
...
@@ -59,7 +59,7 @@ def ira_por_quantidade_disciplinas(df):
...
@@ -59,7 +59,7 @@ def ira_por_quantidade_disciplinas(df):
total_students
=
len
(
df
[
"
MATR_ALUNO
"
])
total_students
=
len
(
df
[
"
MATR_ALUNO
"
])
for
i
in
range
(
total_students
):
for
i
in
range
(
total_students
):
matr
=
(
df
[
"
MATR_ALUNO
"
][
i
]
)
matr
=
df
[
"
MATR_ALUNO
"
][
i
]
if
(
not
(
matr
in
students
)):
if
(
not
(
matr
in
students
)):
students
[
matr
]
=
{}
students
[
matr
]
=
{}
...
@@ -67,19 +67,22 @@ def ira_por_quantidade_disciplinas(df):
...
@@ -67,19 +67,22 @@ def ira_por_quantidade_disciplinas(df):
semestre
=
str
(
df
[
"
PERIODO
"
][
i
])
semestre
=
str
(
df
[
"
PERIODO
"
][
i
])
situacao
=
int
(
df
[
"
SITUACAO
"
][
i
])
situacao
=
int
(
df
[
"
SITUACAO
"
][
i
])
nota
=
float
(
df
[
"
MEDIA_FINAL
"
][
i
])
nota
=
float
(
df
[
"
MEDIA_FINAL
"
][
i
])
carga
=
float
(
df
[
"
CH_TOTAL
"
][
i
])
media_credito
=
int
(
df
[
"
MEDIA_CREDITO
"
][
i
])
media_credito
=
int
(
df
[
"
MEDIA_CREDITO
"
][
i
])
if
(
situacao
in
Situation
.
SITUATION_AFFECT_IRA
and
media_credito
!=
0
):
if
(
situacao
in
Situation
.
SITUATION_AFFECT_IRA
and
media_credito
!=
0
):
if
not
(
ano
+
"
/
"
+
semestre
in
students
[
matr
]):
if
not
(
ano
+
"
/
"
+
semestre
in
students
[
matr
]):
students
[
matr
][
ano
+
"
/
"
+
semestre
]
=
[
0
,
0
]
students
[
matr
][
ano
+
"
/
"
+
semestre
]
=
[
0
,
0
,
0
]
students
[
matr
][
ano
+
"
/
"
+
semestre
][
0
]
+=
nota
students
[
matr
][
ano
+
"
/
"
+
semestre
][
0
]
+=
nota
*
carga
students
[
matr
][
ano
+
"
/
"
+
semestre
][
1
]
+=
1
students
[
matr
][
ano
+
"
/
"
+
semestre
][
1
]
+=
1
students
[
matr
][
ano
+
"
/
"
+
semestre
][
2
]
+=
carga
for
matr
in
students
:
for
matr
in
students
:
for
periodo
in
students
[
matr
]:
for
periodo
in
students
[
matr
]:
if
(
students
[
matr
][
periodo
][
1
]
!=
0
):
if
(
students
[
matr
][
periodo
][
2
]
!=
0
):
students
[
matr
][
periodo
][
0
]
/=
students
[
matr
][
periodo
][
1
]
*
100
students
[
matr
][
periodo
][
0
]
/=
students
[
matr
][
periodo
][
2
]
*
100
return
(
students
)
return
(
students
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment