回答編集履歴
3
コード追加
test
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
>>> np_heights[np_positions == 'GK']
|
4
4
|
|
5
5
|
array([191])
|
6
|
+
|
7
|
+
>>> np_heights[np_positions == 'GK'][0]
|
8
|
+
|
9
|
+
191
|
6
10
|
|
7
11
|
```
|
8
12
|
|
2
numpyの方法追加
test
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
```python
|
2
|
+
|
3
|
+
>>> np_heights[np_positions == 'GK']
|
4
|
+
|
5
|
+
array([191])
|
6
|
+
|
7
|
+
```
|
8
|
+
|
9
|
+
|
10
|
+
|
1
11
|
numpyを使わない方法なら・・・
|
2
12
|
|
3
13
|
|
1
方法追加
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
numpyを使わない方法
|
1
|
+
numpyを使わない方法なら・・・
|
2
2
|
|
3
3
|
|
4
4
|
|
@@ -7,3 +7,15 @@
|
|
7
7
|
gk_heights = heights[positions.index('GK')]
|
8
8
|
|
9
9
|
```
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
あるいは
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
```python
|
18
|
+
|
19
|
+
gk_heights = dict(zip(positions, heights))['GK']
|
20
|
+
|
21
|
+
```
|