I use a picture a thorough understanding of the numpy.meshgrid () meaning

np.meshgrid () understanding

import numpy as np
pointx = np.array([1,2,3])
pointy = np.array([-1,-2])
mesh = np.meshgrid(pointx,pointy)
mesh
[array([[1, 2, 3],
        [1, 2, 3]]),
 array([[-1, -1, -1],
        [-2, -2, -2]])]
xs, ys = np.meshgrid(pointx,pointy)
xs
array([[1, 2, 3],
       [1, 2, 3]])
ys
array([[-1, -1, -1],
       [-2, -2, -2]])

Then how to understand it meshgrid

Reference: https://www.geeksforgeeks.org/numpy-meshgrid-function/

Published 308 original articles · won praise 149 · Views 150,000 +

Guess you like

Origin blog.csdn.net/qq_43827595/article/details/104636342