numpy
borgWarp
listOperation
#migrated

Numpy > meshgrid() > x, y 方向のループ数 > x方向:len(mx[0]), y方向:len(mx)

More than 1 year has passed since last update.
動作環境
ideone (Python 3)

https://ideone.com/RzHTsb

import numpy as np

inx = np.linspace(-3, 3, 5, endpoint=True)
iny = np.linspace(-5, 5, 10, endpoint=True)
mx, my = np.meshgrid(inx, iny)

print("===y loop===")
for iy in range(len(mx)):
    print(mx[iy][0], my[iy][0])
print("===x loop===")
for ix in range(len(mx[0])):
    print(mx[0][ix], my[0][ix])

run
===y loop===
(-3.0, -5.0)
(-3.0, -3.8888888888888888)
(-3.0, -2.7777777777777777)
(-3.0, -1.6666666666666665)
(-3.0, -0.55555555555555536)
(-3.0, 0.55555555555555536)
(-3.0, 1.666666666666667)
(-3.0, 2.7777777777777786)
(-3.0, 3.8888888888888893)
(-3.0, 5.0)
===x loop===
(-3.0, -5.0)
(-1.5, -5.0)
(0.0, -5.0)
(1.5, -5.0)
(3.0, -5.0)