标签: python numpy
z [...]的含义是什么,不确定该语法。谢谢。 该代码只是试图通过2个容器生成一个循环。
A = np.arange(3).reshape(3, 1) B = np.arange(3).reshape(1, 3) it = np.nditer([A, B, None]) for x, y, z in it: z[...] = x + y print(it.operands[2]) # [[0 1 2] # [1 2 3] # [2 3 4]]