回答編集履歴
2
コード修正
answer
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
> x軸に点数、y軸に点数毎の人数を表示させたいと考えています。
|
2
2
|
|
3
3
|
barではなくhistで描画すべきかと思います。
|
4
|
-
|
4
|
+
また、値が`6/14実施`の行にひきづられて文字列と判定されているようなので`int`に変換します。
|
5
5
|
```Python
|
6
6
|
import pandas as pd
|
7
7
|
import matplotlib.pyplot as plt
|
@@ -47,12 +47,10 @@
|
|
47
47
|
df = pd.read_csv(StringIO(s))
|
48
48
|
a = df['第1回']
|
49
49
|
b = a.drop(0)
|
50
|
-
x = b
|
50
|
+
x = b.astype(int)
|
51
51
|
|
52
|
-
print(x)
|
53
|
-
|
54
52
|
#height = range(0,34)
|
55
53
|
plt.hist(x) # 変更
|
56
54
|
plt.show()
|
57
55
|
```
|
58
|
-

|
1
コード修正
answer
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
1
|
+
> x軸に点数、y軸に点数毎の人数を表示させたいと考えています。
|
2
|
+
|
2
|
-
|
3
|
+
barではなくhistで描画すべきかと思います。
|
4
|
+
|
3
5
|
```Python
|
4
6
|
import pandas as pd
|
5
7
|
import matplotlib.pyplot as plt
|
@@ -45,10 +47,12 @@
|
|
45
47
|
df = pd.read_csv(StringIO(s))
|
46
48
|
a = df['第1回']
|
47
49
|
b = a.drop(0)
|
48
|
-
x = b
|
50
|
+
x = b
|
49
51
|
|
52
|
+
print(x)
|
53
|
+
|
50
|
-
height = range(0,34)
|
54
|
+
#height = range(0,34)
|
51
|
-
plt.
|
55
|
+
plt.hist(x) # 変更
|
52
56
|
plt.show()
|
53
57
|
```
|
54
|
-

|