[SciPy-user] change array index order

Nathan Bell wnbell@gmail....
Mon Mar 3 11:15:33 CST 2008

On Mon, Mar 3, 2008 at 10:54 AM, BK <lists@benair.net> wrote:

>  So, is there a way to tell scipy to somehow 'map' one index direction to
>  another one, like:
>         data_new[n,j,i] -> data_old[j,i,n]
>  without copying all the data?

I've never used it, but I think rollaxis() is what you want:
   data_new = rollaxis(data_old,2,0)

If that doesn't work, then use two calls to swapaxes()


Nathan Bell wnbell@gmail.com

More information about the SciPy-user mailing list