Code: Select all
import numpy as np
Point = [('x', 'i4'), ('y', 'i4')]
a = np.zeros((4, 4), dtype='u1')
b = np.full_like(a, fill_value=(-1, 1), dtype=Point) # fails
b = np.full_like(a, -1, dtype=Point) # works
Code: Select all
multiarray.copyto(res, fill_value, casting='unsafe')
ValueError: could not broadcast input array from shape (2,) into shape (4,4)
< /code>
. Gibt es eine andere Lösung als explizit zugewiesen (-1, 1)