[Numpy-discussion] Slicing/selection in multiple dimensions simultaneously
Fri Feb 27 14:35:03 CST 2009
On 26-Feb-09, at 10:00 PM, Jonathan Taylor wrote:
> Am I right to assume that there is no way elegant way to interact with
> slices. i.e. Is there anyway to get
> to work? So that the dimension is completely specified? Or perhaps
> the only way to do this is via
> If anyone knows a better way?
a[[2,3,6],:,:][:,:,[3,2]] should do what you want.
In : a = randn(50,50,50)
In : all(a[ix_([2,3,6],range(a.shape),[3,2])] == a[[2,3,6],:,:]
More information about the Numpy-discussion