📜  将两个坐标矩阵合并为 1 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:35.133000             🧑  作者: Mango

代码示例1
x = np.linspace(x_min, x_max,num_x)
y = np.linspace(y_min, y_max,num_y)

XY = np.meshgrid(x,y)
# Here you have a tuple of 2 coordinate matrix

mat = np.array(XY).transpose()
# Transpose will transform your (2,num_y,num_x) array into
# the desired (num_x,num_y,2) array.