np.meshgrid()
from
NumPy
np.meshgrid()
https://numpy.org/doc/stable/reference/generated/numpy.meshgrid.html
座標ベクトルから座標行列を生成
code:py
x_lin = np.linspace(0, 3, 3)
y_lin = np.linspace(0, 3, 3)
x, y = np.meshgrid(x_lin, y_lin)
x
# array([
0. , 1.5, 3.
,
#
0. , 1.5, 3.
,
#
0. , 1.5, 3.
])
y
# array([
0. , 0. , 0.
,
#
1.5, 1.5, 1.5
,
#
3. , 3. , 3.
])