@ryota4649
Revisions
Report this question
Subscribe question
Help us understand the problem. What is going on with this question?
Q&A
Closed

Q&A
Closed

Python初心者です。

# コード

x = np.array(hakohigezu)
plt.title('height')
plt.grid()

plt.boxplot(x)
plt.show()

# hakohigezu(要素)

[300, 25, 300, 25, 25, 75, 25, 75, 300, 300, 300, 25, 75, 25, 75, 300, 750, 25, 300, 300, 25, 300, 1000, 75, 1000, 300, 300, 25, 750, 300, 75, 300, 300, 25, 25, 75, 300, 25, 300, 75, 25, 300, 75, 300, 750, 25, 750, 75, 25, 75, 75, 300, 300, 750, 75, 300, 75, 25, 1000, 300, 25, 300, 75, 25, 75, 750, 300, 300, 25, 300, 1000, 750, 75, 300, 25, 300, 75, 75, 25, 25, 300, 25, 300, 25, 300, 1000, 750, 25, 300, 75, 750, 300, 25, 300, 25, 300, 75, 75, 300, 300, 75, 25, 300, 25, 300, 300, 750, 300, 300, 750, 25, 300, 25, 750, 25, 25, 25, 300, 1000, 25, 750, 300, 25, 25, 75, 75, 1000, 750, 25, 25, 75, 25, 750, 75, 25, 25, 300, 750, 300, 300, 75, 25, 75, 25, 75, 25, 1000, 75, 300, 25, 75, 75, 1000, 25, 300, 300, 25, 300, 300, 300, 300, 300, 300, 75, 300, 300, 300, 300, 300, 25, 300, 300, 300, 300, 750, 300, 750, 25, 75, 300, 300, 750, 300, 25, 75, 300, 300, 300, 75, 75, 300, 25, 300, 300, 1000, 25, 75, 300, 300, 25, 75, 300]

どうすればよいでしょうか。

0
2

データに該当する要素が存在しないために表示されないのだと思います。

`750``1000`は突出しすぎていて「⚬」で表されているようですね。

```import numpy as np
import matplotlib.pyplot as plt

hakohigezu = [300, 25, 300, 25, 25, 75, 25, 75, 300, 300, 300, 25, 75, 25, 75, 300, 750, 25, 300, 300, 25, 300, 1000, 75, 1000, 300, 300, 25, 750, 300, 75, 300, 300, 25, 25, 75, 300, 25, 300, 75, 25, 300, 75, 300, 750, 25, 750, 75, 25, 75, 75, 300, 300, 750, 75, 300, 75, 25, 1000, 300, 25, 300, 75, 25, 75, 750, 300, 300, 25, 300, 1000, 750, 75, 300, 25, 300, 75, 75, 25, 25, 300, 25, 300, 25, 300, 1000, 750, 25, 300, 75, 750, 300, 25, 300, 25, 300, 75, 75, 300, 300, 75, 25, 300, 25, 300, 300, 750, 300, 300, 750, 25, 300, 25, 750, 25, 25, 25, 300, 1000, 25, 750, 300, 25, 25, 75, 75, 1000, 750, 25, 25, 75, 25, 750, 75, 25, 25, 300, 750, 300, 300, 75, 25, 75, 25, 75, 25, 1000, 75, 300, 25, 75, 75, 1000, 25, 300, 300, 25, 300, 300, 300, 300, 300, 300, 75, 300, 300, 300, 300, 300, 25, 300, 300, 300, 300, 750, 300, 750, 25, 75, 300, 300, 750, 300, 25, 75, 300, 300, 300, 75, 75, 300, 25, 300, 300, 1000, 25, 75, 300, 300, 25, 75, 300, 1, 400]
x = np.array(hakohigezu)
plt.title('height')
plt.grid()
plt.boxplot(x)
plt.show()
```

0
ありがとうございました。

25パーセンタイル 25.0
50パーセンタイル 300.0
75パーセンタイル 300.0
max : 1000
min : 25

ソースコード
```import numpy as np
hakohigezu = [300, 25, 300, 25, 25, 75, 25, 75, 300, 300, 300, 25, 75, 25, 75, 300, 750, 25, 300, 300, 25, 300, 1000, 75, 1000, 300, 300, 25, 750, 300, 75, 300, 300, 25, 25, 75, 300, 25, 300, 75, 25, 300, 75, 300, 750, 25, 750, 75, 25, 75, 75, 300, 300, 750, 75, 300, 75, 25, 1000, 300, 25, 300, 75, 25, 75, 750, 300, 300, 25, 300, 1000, 750, 75, 300, 25, 300, 75, 75, 25, 25, 300, 25, 300, 25, 300, 1000, 750, 25, 300, 75, 750, 300, 25, 300, 25, 300, 75, 75, 300, 300, 75, 25, 300, 25, 300, 300, 750, 300, 300, 750, 25, 300, 25, 750, 25, 25, 25, 300, 1000, 25, 750, 300, 25, 25, 75, 75, 1000, 750, 25, 25, 75, 25, 750, 75, 25, 25, 300, 750, 300, 300, 75, 25, 75, 25, 75, 25, 1000, 75, 300, 25, 75, 75, 1000, 25, 300, 300, 25, 300, 300, 300, 300, 300, 300, 75, 300, 300, 300, 300, 300, 25, 300, 300, 300, 300, 750, 300, 750, 25, 75, 300, 300, 750, 300, 25, 75, 300, 300, 300, 75, 75, 300, 25, 300, 300, 1000, 25, 75, 300, 300, 25, 75, 300]
x = np.array(hakohigezu)
plt.grid()

plt.boxplot(x, sym="+")
plt.show()

plt.hist(x, bins=100)
plt.show()

print("25パーセンタイル", np.percentile(x, 25))
print("50パーセンタイル", np.percentile(x, 50))
print("75パーセンタイル", np.percentile(x, 75))
print("max : ", max(x))
print("min : ", min(x))
```

この方の記事が参考になりますよ。
https://qiita.com/Kenta-Han/items/b074b499114f38d6de3e

0
ありがとうございました。
Help us understand the problem. What is going on with this answer?