sns.boxplot(df['Points'])
输出:
prob= [108, 110, 123, 134, 135, 145, 167, 187, 199]
lex = []
for i in prob:
exp= i*(1/9)
lex.append(exp)
print(lex)
[12.0, 12.222222222222221, 13.666666666666666, 14.888888888888888, 15.0, 16.11111111111111, 18.555555555555554, 20.777777777777775, 22.11111111111111]
np.sum(lex)
输出:
145.33333333333331
dc= pd.read_csv('Q9_a.csv')
dc.head()
输出:
Index | speed | dist | |
0 | 1 | 4 | 2 |
1 | 2 | 4 | 10 |
2 | 3 | 7 | 4 |
3 | 4 | 7 | 22 |
4 | 5 | 8 | 16 |
(dc['speed']).skew(), (dc['speed']).kurt()
输出:
(-0.11750986144663393, -0.5089944204057617)
(dc['dist']).skew(), (dc['dist']).kurt()
输出:
(0.8068949601674215, 0.4050525816795765)
sns.histplot(dc['dist'])
输出:
<Axes: xlabel='dist', ylabel='Count'>
sns.histplot(dc['speed'])
输出:
<Axes: xlabel='speed', ylabel='Count'>
dc2= pd.read_csv('Q9_b.csv')
dc2.head()
输出:
Unnamed: 0 | SP | WT | |
0 | 1 | 104.185353 | 28.762059 |
1 | 2 | 105.461264 | 30.466833 |
2 | 3 | 105.461264 | 30.193597 |
3 | 4 | 113.461264 | 30.632114 |
4 | 5 | 104.461264 | 29.889149 |
dc2['SP'].skew().round(3), dc2['SP'].kurt().round(3)
输出:
(1.611, 2.977)
dc2['WT'].skew().round(3), dc2['WT'].kurt().round(3)
输出:
(-0.615, 0.95)
plt.figure(figsize=(8,4), dpi=80)
plt.subplot(1,2,1)
sns.histplot(dc2['SP'])
plt.subplot(1,2,2)
sns.histplot(dc2['WT'])
plt.show()