我用一张图彻底理解了numpy.meshgrid()的含义

np.meshgrid()的理解

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]])

那怎么来理解meshgrid呢

参考:https://www.geeksforgeeks.org/numpy-meshgrid-function/

发布了308 篇原创文章 · 获赞 149 · 访问量 15万+

猜你喜欢

转载自blog.csdn.net/qq_43827595/article/details/104636342