Re: [Numpy-discussion] rollaxis
by A. M. Archibald other posts by this author
Dec 13 2006 12:29PM messages near this date
[Numpy-discussion] rollaxis
|
Re: [Numpy-discussion] rollaxis
On 13/12/06, Pierre GM <pgmdevlist@[...].com> wrote:
> All,
> I have a ND array whose axes I want to reorganize, so that axis "i" is at the
> end while the others stay in their relative position. What's the easiest ?
Generate an axis-permutation tuple and use transpose:
s = list(A.shape)
s.remove(i)
s.append(i)
B = A.transpose(s)
A. M. Archibald
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Thread:
Pierre GM
A. M. Archibald
Pierre GM
Pierre GM
|