- 此问题在此处已有答案**:
Replace sub part of matrix by another small matrix in numpy(5个答案)
5小时前关门了。
我有一个大小为(3x2)的数组。我想把这些数组值插入到4x3的零数组中。我怎样在python中实现它呢?
import numpy as np
a = np.zeros((4,3))
b = np.ones((3, 2))
for i in range(4):
for j in range(3):
a[i,j] = b[i, j]
1条答案
按热度按时间rmbxnbpk1#