質問編集履歴

1

コードを載せました

2023/01/17 06:49

投稿

rereha
rereha

スコア7

test CHANGED
File without changes
test CHANGED
@@ -14,3 +14,23 @@
14
14
  こことかだと変な数字が入ってあまり使いたくありませんでした。
15
15
 
16
16
 
17
+
18
+ 例えばこういうエラーです。
19
+ 遅れて申し訳ございません。
20
+
21
+ ```Python
22
+ import numpy as np
23
+ a = np.arange(12).reshape((3, 4))
24
+
25
+ b=np.insert(a, 1,np.empty([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]), axis=0)###0が40個続いています
26
+
27
+ print(b)
28
+ ```
29
+
30
+ 次のようなエラーが出ます
31
+
32
+ ValueError Traceback (most recent call last)
33
+ Input In [4], in <cell line: 1>()
34
+ ----> 1 b=np.insert(a, 1,np.empty([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]), axis=0)
35
+
36
+ ValueError: maximum supported dimension for an ndarray is 32, found 40