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
3124803f
Commit
3124803f
authored
7 years ago
by
omdj17
Browse files
Options
Downloads
Patches
Plain Diff
taxas gerais para cada disciplina pronta
parent
ff73b513
No related branches found
No related tags found
1 merge request
!1
WIP: Development
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
script/analysis/course_analysis.py
+11
-9
11 additions, 9 deletions
script/analysis/course_analysis.py
with
11 additions
and
9 deletions
script/analysis/course_analysis.py
+
11
−
9
View file @
3124803f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
pandas
as
pd
import
pandas
as
pd
import
numpy
as
np
import
numpy
as
np
df
=
pd
.
read_excel
(
"
../base/historico.xls
"
)
df
=
pd
.
read_excel
(
"
../base/
base-2016-1/
historico.xls
"
)
# imprime completamente um dataframe
# imprime completamente um dataframe
def
print_analise
(
d
):
def
print_analise
(
d
):
...
@@ -15,18 +15,20 @@ def func(x,matr):
...
@@ -15,18 +15,20 @@ def func(x,matr):
return
(
x
[
'
counts
'
]
/
c
)
return
(
x
[
'
counts
'
]
/
c
)
#quantidade de matriculas
#quantidade de matriculas
def
q
nt_matr
(
df
):
def
cou
nt
s
_matr
(
df
):
return
df
.
groupby
([
'
COD_ATIV_CURRIC
'
]).
size
()
return
df
.
groupby
([
'
COD_ATIV_CURRIC
'
]).
size
()
def
analise
(
df
):
def
analysis
(
df
):
c
=
df
.
groupby
([
'
COD_ATIV_CURRIC
'
]).
size
()
qnt_matr
=
counts_matr
(
df
)
#quantidade de matriculas disciplina
diciplinas
=
df
.
groupby
([
'
COD_ATIV_CURRIC
'
,
'
SIGLA
'
]).
size
().
reset_index
(
name
=
'
counts
'
)
#conta quantas vezes os valores de 'SIGLA' se repete para cada disciplina
i
=
diciplinas
.
groupby
([
'
COD_ATIV_CURRIC
'
,
'
SIGLA
'
,
'
counts
'
]).
apply
(
lambda
x
:
func
(
x
,
matr
)).
reset_index
(
name
=
'
taxas gerais
'
)
disciplinas
=
df
.
groupby
([
'
COD_ATIV_CURRIC
'
,
'
SIGLA
'
]).
size
().
reset_index
(
name
=
'
counts
'
)
print_analise
(
i
)
#adiciona mais uma coluna ao df disciplina com as taxas de cada valor de 'SIGLA'
disciplina
=
disciplinas
.
groupby
([
'
COD_ATIV_CURRIC
'
,
'
SIGLA
'
,
'
counts
'
]).
apply
(
lambda
x
:
func
(
x
,
matr
)).
reset_index
(
name
=
'
taxas gerais
'
)
return
disciplina
matr
=
q
nt_matr
(
df
)
matr
=
cou
nt
s
_matr
(
df
)
analis
e
(
df
)
anal
ys
is
(
df
)
...
...
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