I\'m looking for a clear comparison of meshgrid-like functions. Unfortunately I don\'t find it!
Numpy http://docs.scipy.org/doc/numpy/reference/ provides
np.mgrid
and np.meshgrid()
do the same thing but the first and the second axis are swapped:
# 3D
d1, d2, d3 = np.mgrid[0:10, 0:10, 0:10]
d11, d22, d33 = np.meshgrid(np.arange(10),np.arange(10),np.arange(10))
np.array_equal(d1,d11)
yields False
. Just swap the first two dimensions:
d11 = np.transpose(d11,[1,0,2])
np.array_equal(d1,d11)
yields True
.