meshgrid

获得一个网格

nx,ny = (3,2)
x = np.linspace(0,1,nx)
#[ 0. 0.5 1. ]
y = np.linspace(0,1,ny)
# [0. 1.]
xv,yv = np.meshgrid(x,y)
'''
xv
[[ 0. 0.5 1. ]
[ 0. 0.5 1. ]]
yv
[[ 0. 0. 0.]
[ 1. 1. 1.]]
'''

posted @ 2020-07-24 12:15  6+0  阅读(176)  评论(0编辑  收藏  举报