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
e57cad1b
Commit
e57cad1b
authored
6 years ago
by
Maria Ruy
Browse files
Options
Downloads
Patches
Plain Diff
adega#46 Análise de desvio padrão no turma ingresso
parent
ea1bc255
No related branches found
No related tags found
1 merge request
!1
WIP: Development
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/script/analysis/admission_analysis.py
+21
-6
21 additions, 6 deletions
src/script/analysis/admission_analysis.py
src/script/build_cache.py
+27
-12
27 additions, 12 deletions
src/script/build_cache.py
with
48 additions
and
18 deletions
src/script/analysis/admission_analysis.py
+
21
−
6
View file @
e57cad1b
...
...
@@ -9,8 +9,7 @@ import numpy as np
ANO_ATUAL
=
2017
SEMESTRE_ATUAL
=
2
def
media_ira_turma_ingresso
(
df
):
def
iras_alunos_turmas_ingressos
(
df
):
iras
=
ira_alunos
(
df
)
turmas_ingresso_grr
=
df
.
groupby
([
...
...
@@ -31,11 +30,27 @@ def media_ira_turma_ingresso(df):
for
grr
in
iras
:
semestre_ano
=
ano_semestre_do_grr
[
grr
]
resultados
[
semestre_ano
].
append
(
iras
[
grr
])
return
resultados
def
media_ira_turma_ingresso
(
df
):
iras_alunos_por_turma
=
iras_alunos_turmas_ingressos
(
df
)
# Calcula a média do ira para cada turma_ingresso
for
r
in
resultados
:
aux
=
np
.
array
(
resultados
[
r
])
resultados
=
{}
for
r
in
iras_alunos_por_turma
:
aux
=
np
.
array
(
iras_alunos_por_turma
[
r
])
resultados
[
r
]
=
np
.
mean
(
aux
)
return
resultados
def
desvio_padrao_turma_ingresso
(
df
):
iras_alunos_por_turma
=
iras_alunos_turmas_ingressos
(
df
)
# Calcula o desvio padrão para cada turma_ingresso
resultados
=
{}
for
r
in
iras_alunos_por_turma
:
aux
=
np
.
array
(
iras_alunos_por_turma
[
r
])
resultados
[
r
]
=
np
.
std
(
aux
)
return
resultados
This diff is collapsed.
Click to expand it.
src/script/build_cache.py
+
27
−
12
View file @
e57cad1b
...
...
@@ -5,6 +5,7 @@ from script.analysis.student_analysis import *
from
script.analysis.course_analysis
import
*
from
script.analysis.admission_analysis
import
*
from
collections
import
defaultdict
try
:
to_unicode
=
unicode
...
...
@@ -20,13 +21,13 @@ def build_cache(dataframe):
for
cod
,
df
in
dataframe
.
groupby
(
'
COD_CURSO
'
):
path
=
path
+
'
/
'
+
cod
+
'
/
'
generate_degree_data
(
path
,
df
)
generate_student_data
(
path
+
'
students/
'
,
df
)
#
generate_degree_data(path, df)
#
generate_student_data(path+'students/',df)
generate_admission_data
(
path
+
'
/admission/
'
,
df
)
#generate_student_list(path)
generate_admission_data
(
path
,
dataframe
)
generate_admission_list
(
path
,
dataframe
)
generate_course_data
(
path
+
'
disciplina/
'
,
dataframe
)
#
generate_admission_data(path, dataframe)
#
generate_admission_list(path, dataframe)
#
generate_course_data(path+'disciplina/' ,dataframe)
def
generate_degree_data
(
path
,
dataframe
):
ensure_path_exists
(
path
)
...
...
@@ -139,17 +140,31 @@ def generate_student_list(path):
def
generate_admission_data
(
path
,
df
):
media_ira
=
media_ira_turma_ingresso
(
df
)
listagem
=
[]
# x é uma tupla (ano,semestre)
for
x
in
media_ira
:
listagem
.
append
({
"
ira
"
:
media_ira
[
x
],
analises
=
[
(
"
ira
"
,
media_ira_turma_ingresso
(
df
)),
(
"
desvio_padrao
"
,
desvio_padrao_turma_ingresso
(
df
)),
]
# cria um dicionario com as analises para cada turma
turmas
=
defaultdict
(
dict
)
for
a
in
analises
:
for
x
in
a
[
1
]:
turmas
[
x
][
a
[
0
]
]
=
a
[
1
][
x
]
listagem
=
[]
for
t
in
turmas
:
resumo_turma
=
{
"
ano
"
:
x
[
0
],
"
semestre
"
:
x
[
1
]
})
}
for
analise
in
turmas
[
t
]:
resumo_turma
[
analise
]
=
turmas
[
t
][
analise
]
listagem
.
append
(
resumo_turma
)
save_json
(
path
+
"
lista_turma_ingresso.json
"
,
listagem
)
...
...
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