回答編集履歴

2

プログラム変更

2019/12/18 05:56

投稿

shiracamus
shiracamus

スコア5406

test CHANGED
@@ -14,7 +14,9 @@
14
14
 
15
15
  for row in data:
16
16
 
17
- for i, x, y, z in [row[i:i+4] for i in range(0, len(row), 4)]:
17
+ items = [row[i:i+4] for i in range(0, len(row), 4)]
18
+
19
+ for i, x, y, z in items:
18
20
 
19
21
  print(x, y, z)
20
22
 

1

プログラム変更

2019/12/18 05:56

投稿

shiracamus
shiracamus

スコア5406

test CHANGED
@@ -4,16 +4,32 @@
4
4
 
5
5
  ```python
6
6
 
7
- >>> data = [[0, 1, 2, 3], [1, 11, 12, 13], [2, 21, 22, 23]]
7
+ data = [[0.00000000e+00, -1.07784731e-01, 0.00000000e+00, 5.34467328e+02 ,
8
8
 
9
- >>> remove_index = [items[1:] for items in data]
9
+ 1.00000000e+00, -8.69184320e+01, -3.12723766e+01, 5.44275750e+02 ,
10
10
 
11
- >>> remove_index
11
+ 2.00000000e+00, -1.56086607e+02, -8.56866898e+01, 2.90261612e+02]]
12
12
 
13
+
14
+
15
+ for row in data:
16
+
13
- [[1, 2, 3], [11, 12, 13], [21, 22, 23]]
17
+ for i, x, y, z in [row[i:i+4] for i in range(0, len(row), 4)]:
18
+
19
+ print(x, y, z)
14
20
 
15
21
  ```
16
22
 
17
23
 
18
24
 
25
+ 実行結果
26
+
27
+ ```
28
+
29
+ -0.107784731 0.0 534.467328
30
+
31
+ -86.918432 -31.2723766 544.27575
32
+
19
- 先頭の `>>>` は対話型Pythonインタープリタのプロンプトです。
33
+ -156.086607 -85.6866898 290.261612
34
+
35
+ ```