teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

エラーメッセージが一部誤っていたため修正

2021/01/07 08:18

投稿

marusa
marusa

スコア17

title CHANGED
File without changes
body CHANGED
@@ -32,7 +32,7 @@
32
32
  ひとまず適当なサイズで作っておいて、後からnp.appendしようと以下のコードを試してみたものの、
33
33
  キャストできないという以下のエラーが出ます。
34
34
  ```
35
- grid['points'][0] = np.append(grid['points'][0], points, axis = 0)
35
+ p['points'][0] = np.append(p['points'][0], points, axis = 0)
36
36
  ValueError: could not broadcast input array from shape (4,2) into shape (2,2)
37
37
  ```
38
38
 

1

コード内のdtype指定で誤っている場所があったため修正

2021/01/07 08:18

投稿

marusa
marusa

スコア17

title CHANGED
File without changes
body CHANGED
@@ -44,7 +44,7 @@
44
44
  align=True
45
45
  )
46
46
 
47
- p = np.zeros(1, dtype=GRID)
47
+ p = np.zeros(1, dtype=PLAIN)
48
48
 
49
49
  points = np.array([[1, 1], [1, 2]])
50
50
  p['points'][0] = np.append(p['points'][0], points, axis = 0)