Мой код:
Код: Выделить всё
a = np.random.random((4, 5))
m, n = a.shape
b = np.zeros((m+1, n+1))
b[1:-1,1:-1] = a
a,b
Код: Выделить всё
ValueError: could not broadcast input array from shape (4,5) into shape (3,4)Подробнее здесь: https://stackoverflow.com/questions/707 ... ting-array