-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvisualize.py
36 lines (30 loc) · 957 Bytes
/
visualize.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
def instance_dataframe(csv_file):
dataframe = pd.read_csv(csv_file, sep=';')
return dataframe
def grafico_idade(dataframe):
"""
GRÁFICO DE IDADE DOS ALUNOS DO RIO DE JANEIRO
:return:
"""
sns.set_style("darkgrid")
sns.countplot(data=dataframe, x='IDADE', palette="Spectral")
plt.xlabel("Idades")
plt.ylabel("Quantitativo alunos")
plt.title("Idade alunos ProUni - RJ - 2018")
plt.show()
def grafico_raca(dataframe):
"""
GRÁFICO DE RAÇA DOS ALUNOS DO RIO DE JANEIRO
:return:
"""
sns.set_style("darkgrid")
ax = sns.countplot(data=dataframe, x='RACA_BENEFICIARIO_BOLSA')
plt.xlabel("Cor")
plt.ylabel("Quantitativo")
plt.title("Alunos por raça ProUni - RJ - 2018")
for p in ax.patches:
ax.annotate('{}'.format(p.get_height()), (p.get_x() + 0.25, p.get_height() + 50))
plt.show()