[Numpy-discussion] Slicing/selection in multiple dimensions simultaneously
Sat Feb 28 11:27:07 CST 2009
This does seem like the only way to write this nicely. Unfortunately,
I think this may be wasteful memory wise (in contrast to what the
obvious matlab code would do) as it constructs an array with the whole
first index intact at first. I think I will use it anyways though as
I find the other notations pretty awkward.
On Fri, Feb 27, 2009 at 11:54 PM, David Warde-Farley <email@example.com> wrote:
> On 27-Feb-09, at 3:35 PM, David Warde-Farley wrote:
>> a[[2,3,6],:,:][:,:,[3,2]] should do what you want.
> Slightly more elegantly (I always forget about this syntax):
> a[[2,3,6], ...][..., [3,2]]
> Numpy-discussion mailing list
More information about the Numpy-discussion