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
Harbor Registry
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
7d018ce8
Commit
7d018ce8
authored
7 years ago
by
Legton
Browse files
Options
Downloads
Plain Diff
Merge branch 'back-to-origins' into degree
parents
b55666d2
0daa8dc3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
script/analysis/student_analysis.py
+18
-0
18 additions, 0 deletions
script/analysis/student_analysis.py
script/base/dataframe_base.py
+13
-2
13 additions, 2 deletions
script/base/dataframe_base.py
script/build_cache.py
+27
-13
27 additions, 13 deletions
script/build_cache.py
with
58 additions
and
15 deletions
script/analysis/student_analysis.py
+
18
−
0
View file @
7d018ce8
import
re
import
pandas
as
pd
import
numpy
as
np
from
utils.situations
import
*
def
average_ira
(
df
):
print
(
df
)
new_df
=
df
.
dropna
(
subset
=
[
'
MEDIA_FINAL
'
])
new_df
=
new_df
[
new_df
[
'
MEDIA_FINAL
'
]
<=
100
]
if
not
new_df
.
empty
:
grade
=
np
.
sum
(
new_df
[
'
MEDIA_FINAL
'
]
*
new_df
[
'
CH_TOTAL
'
])
total_ch
=
np
.
sum
(
new_df
[
'
CH_TOTAL
'
])
*
100
return
grade
/
total_ch
def
pass_rate
(
dt
):
new_dt
=
dt
[
dt
[
'
SITUACAO
'
].
isin
(
Situation
.
SITATUION_PASS
)]
This diff is collapsed.
Click to expand it.
script/base/dataframe_base.py
+
13
−
2
View file @
7d018ce8
...
@@ -2,12 +2,19 @@ import re
...
@@ -2,12 +2,19 @@ import re
import
os
import
os
import
sys
import
sys
import
pandas
as
pd
import
pandas
as
pd
import
numpy
as
np
from
glob
import
glob
from
glob
import
glob
from
json
import
load
as
json_load
from
json
import
load
as
json_load
from
utils.situations
import
*
from
utils.situations
import
*
class
DataframeHolder
:
def
__init__
(
self
,
dataframe
):
self
.
students
=
dataframe
.
groupby
(
'
MATR_ALUNO
'
)
self
.
courses
=
dataframe
.
groupby
(
'
COD_ATIV_CURRIC
'
)
self
.
admission
=
dataframe
.
groupby
([
'
ANO_INGRESSO
'
,
'
SEMESTRE_INGRESSO
'
])
def
load_dataframes
(
cwd
=
'
.
'
):
def
load_dataframes
(
cwd
=
'
.
'
):
dataframes
=
[]
dataframes
=
[]
for
path
,
dirs
,
files
in
os
.
walk
(
cwd
):
for
path
,
dirs
,
files
in
os
.
walk
(
cwd
):
...
@@ -23,7 +30,11 @@ def load_dataframes(cwd='.'):
...
@@ -23,7 +30,11 @@ def load_dataframes(cwd='.'):
dataframes
.
append
(
dh
)
dataframes
.
append
(
dh
)
dataframe
=
fix_dataframes
(
dataframes
)
dataframe
=
fix_dataframes
(
dataframes
)
return
dataframe
dh
=
DataframeHolder
(
dataframe
)
return
dh
def
read_excel
(
path
,
planilha
=
'
Planilha1
'
):
def
read_excel
(
path
,
planilha
=
'
Planilha1
'
):
...
...
This diff is collapsed.
Click to expand it.
script/build_cache.py
+
27
−
13
View file @
7d018ce8
...
@@ -6,13 +6,14 @@ import math
...
@@ -6,13 +6,14 @@ import math
from
datetime
import
timedelta
from
datetime
import
timedelta
from
pathlib
import
Path
from
pathlib
import
Path
from
utils.utils
import
build_path
from
utils.utils
import
build_path
from
analysis.degree_analysis
import
*
import
analysis.degree_analysis
as
de_an
import
analysis.student_analysis
as
st_an
try
:
try
:
to_unicode
=
unicode
to_unicode
=
unicode
except
NameError
:
except
NameError
:
to_unicode
=
str
to_unicode
=
str
def
build_cache
(
dataframe
):
def
build_cache
(
dataframe
):
# os.chdir("../src")
# os.chdir("../src")
path
=
"
cache
"
path
=
"
cache
"
...
@@ -20,21 +21,34 @@ def build_cache(dataframe):
...
@@ -20,21 +21,34 @@ def build_cache(dataframe):
path
+=
"
/curso
"
path
+=
"
/curso
"
build_path
(
path
)
build_path
(
path
)
generate_degree_data
(
path
,
dataframe
)
generate_student_data
(
path
,
dataframe
)
generate_student_data
(
path
)
# generate_degree_data(path, dataframe)
generate_student_list
(
path
)
# generate_student_data(path)
generate_admission_data
(
path
)
# generate_student_list(path)
generate_admission_list
(
path
)
# generate_admission_data(path)
generate_course_data
(
path
)
# generate_admission_list(path)
generate_course_general_data
(
path
)
# generate_course_data(path)
# generate_course_general_data(path)
def
generate_degree_data
(
path
,
dataframe
):
def
generate_degree_data
(
path
,
dataframe
):
average_graduation
(
dataframe
)
de_an
.
average_graduation
(
dataframe
)
general_failure
(
dataframe
)
de_an
.
general_failure
(
dataframe
)
general_ira
(
dataframe
)
de_an
.
general_ira
(
dataframe
)
pass
pass
def
generate_student_data
(
path
):
def
teste
(
d
):
temp
=
d
.
dropna
(
subset
=
[
'
MEDIA_FINAL
'
])
temp
=
temp
[
temp
[
'
MEDIA_FINAL
'
]
<=
100
]
if
not
temp
.
empty
:
#print(temp[['MEDIA_FINAL', 'CH_TOTAL']])
aux
=
np
.
sum
(
temp
[
'
MEDIA_FINAL
'
]
*
temp
[
'
CH_TOTAL
'
])
ch_total
=
np
.
sum
(
temp
[
'
CH_TOTAL
'
])
*
100
print
(
aux
/
ch_total
)
def
generate_student_data
(
path
,
dataframe
):
# student_df = dataframe.groupby('MATR_ALUNO')
dataframe
.
students
.
aggregate
(
teste
)
pass
pass
def
generate_student_list
(
path
):
def
generate_student_list
(
path
):
...
...
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