-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpeplot.py
52 lines (47 loc) · 1.54 KB
/
peplot.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# -*- coding: utf-8 -*-
"""peplot.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1aeWIHKh12Ftd7PhhnUBTx1zwvYstIdoM
"""
import matplotlib.pyplot as plt
anos = [2005, 2007, 2009, 2011, 2013, 2015, 2017, 2019, 2021]
med = [2.6, 3.1, 3.3, 3.6, 3.8, 4.2, 4.3, 4.6, 4.5]
plt.scatter(anos, med, color='b')
plt.plot(anos,med,color='b')
plt.xlabel("Anos")
plt.ylabel("IDEB (média)")
plt.xticks(anos)
plt.grid()
import matplotlib.pyplot as plt
anos = [2005, 2007, 2009, 2011, 2013, 2015, 2017, 2019, 2021]
med = [2.6, 3.1, 3.3, 3.6, 3.8, 4.2, 4.3, 4.6, 4.5]
err = [0.4687651816, 0.5033269535, 0.5696707306, 0.5938571208,
0.6734233743, 0.6660568601, 0.7145699189, 0.7401894213, 0.6577808485]
plt.scatter(anos, med, color='b')
plt.plot(anos,med,color='b')
plt.xlabel("Anos")
plt.ylabel("IDEB (média)")
plt.grid()
plt.xticks(anos)
plt.errorbar(anos, med, err, linestyle='None', capsize=5, color='r')
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
df = pd.read_csv('/content/drive/MyDrive/Colab Notebooks/DFPE.csv', decimal=',')
x = ['2005','2007','2009','2011','2013','2015','2017','2019','2021']
data = df[x]
def ano(a):
y=[]
for i in range(2,480):
s=float(data[a][i].replace(',','.').replace('-','0'))
if(s!=0.0):
y.append(s)
return y
v=[ano('2005'), ano('2007'), ano('2009'), ano('2011'), ano('2013'),
ano('2015'), ano('2017'), ano('2019'), ano('2021')]
plt.grid()
plt.boxplot(v, labels=x)
plt.xlabel('Anos')
plt.ylabel('IDEB')
plt.show()