The efficient way of Array transformation by using numpy
<p>How to change the ARRAY U(Nz,Ny, Nx) to U(Nx,Ny, Nz) by using numpy? thanks</p>

<p>In general, if you want to change the order of data in numpy array, see <a href="http://docs.scipy.org/doc/numpy-1.10.1/reference/routines.array-manipulation.html#rearranging-elements" rel="nofollow">http://docs.scipy.org/doc/numpy-1.10.1/reference/routines.array-manipulation.html#rearranging-elements</a>.</p>

<p>The <code>np.fliplr()</code> and <code>np.flipud()</code> functions can be particularly useful when the transpose is not actually what you want. </p>

<p>Additionally, more general element reordering can be done by creating an index mask, partially explained <a href="http://stackoverflow.com/questions/19984102/select-elements-of-numpy-array-via-boolean-mask-array">here</a></p>

python numpy