更新时间:2022-06-03 18:05:19
使用
Use np.ix_ to map that grid of elements and then assign -
np.ix_
x[np.ix_([0,1], [0,1])] = np.array([[1,0],[0,1]])
给定行和列索引,分配到NumPy数组的网格中