回答編集履歴
1
追記
test
CHANGED
@@ -27,3 +27,23 @@
|
|
27
27
|
# [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]]
|
28
28
|
|
29
29
|
```
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
蛇足ですが、配列操作はnumpyなど使うと便利です。
|
34
|
+
|
35
|
+
```python3
|
36
|
+
|
37
|
+
import numpy as np
|
38
|
+
|
39
|
+
a = np.array(range(1,11))
|
40
|
+
|
41
|
+
b = a.reshape([-1,5])
|
42
|
+
|
43
|
+
print(b)
|
44
|
+
|
45
|
+
# [[ 1 2 3 4 5]
|
46
|
+
|
47
|
+
# [ 6 7 8 9 10]]
|
48
|
+
|
49
|
+
```
|