Re: [Numpy-discussion] combination of list of indices and newaxis not allowed?

2012-02-01 Thread Stéfan van der Walt
On Wed, Feb 1, 2012 at 3:47 AM, Olivier Delalleau wrote: > I think you just can't use newaxis in advanced indexing (doc says "The > newaxis object can be used in the basic slicing syntax", and does not > mention newaxis in the advanced indexing part). Yes, with fancy indexing the two arguments ne

Re: [Numpy-discussion] combination of list of indices and newaxis not allowed?

2012-02-01 Thread Olivier Delalleau
I think you just can't use newaxis in advanced indexing (doc says "The newaxisobject can be used in the basic slicing syntax", and does not mention newaxis in the advanced indexing part). -=- Olivier Le 1 février 2012 0

[Numpy-discussion] combination of list of indices and newaxis not allowed?

2012-02-01 Thread Mark Bakker
Hello list, I am trying to specify the indices of an array with a list and add a newaxis, but that combination doesn't seem to be allowed. Any reason why? Here's an example: a = arange(3) This works: a[[0,2]][:,newaxis] Out[445]: array([[0], [2]]) This is more elegant syntax (and, I tho