Re: [Numpy-discussion] Fancy-indexing reorders output in corner cases?

2012-05-16 Thread Nathaniel Smith
On Tue, May 15, 2012 at 5:03 AM, Travis Oliphant tra...@continuum.io wrote: So, the behavior is actually quite predictable, it's just that in some common cases it doesn't do what you would expect --- especially if you think that [0,1] is the same as :2.   When I wrote this code to begin with

Re: [Numpy-discussion] Fancy-indexing reorders output in corner cases?

2012-05-15 Thread Olivier Delalleau
2012/5/15 Travis Oliphant tra...@continuum.io On May 14, 2012, at 7:07 PM, Stéfan van der Walt wrote: Hi Zach On Mon, May 14, 2012 at 4:33 PM, Zachary Pincus zachary.pin...@yale.edu wrote: The below seems to be a bug, but perhaps it's unavoidably part of the indexing mechanism?

Re: [Numpy-discussion] Fancy-indexing reorders output in corner cases?

2012-05-15 Thread Eric Firing
On 05/14/2012 06:03 PM, Travis Oliphant wrote: What happens, though when you have a[:, in1 :, in2]? in1 and in2 are broadcasted together to create a two-dimensional sub-space that must fit somewhere. Where should it go? Should it replace in1 or in2?I.e. should the output be

[Numpy-discussion] Fancy-indexing reorders output in corner cases?

2012-05-14 Thread Zachary Pincus
Hello all, The below seems to be a bug, but perhaps it's unavoidably part of the indexing mechanism? It's easiest to show via example... note that using [0,1] to pull two columns out of the array gives the same shape as using :2 in the simple case, but when there's additional slicing

Re: [Numpy-discussion] Fancy-indexing reorders output in corner cases?

2012-05-14 Thread Stéfan van der Walt
Hi Zach On Mon, May 14, 2012 at 4:33 PM, Zachary Pincus zachary.pin...@yale.edu wrote: The below seems to be a bug, but perhaps it's unavoidably part of the indexing mechanism? It's easiest to show via example... note that using [0,1] to pull two columns out of the array gives the same

Re: [Numpy-discussion] Fancy-indexing reorders output in corner cases?

2012-05-14 Thread Zachary Pincus
On Mon, May 14, 2012 at 4:33 PM, Zachary Pincus zachary.pin...@yale.edu wrote: The below seems to be a bug, but perhaps it's unavoidably part of the indexing mechanism? It's easiest to show via example... note that using [0,1] to pull two columns out of the array gives the same shape as

Re: [Numpy-discussion] Fancy-indexing reorders output in corner cases?

2012-05-14 Thread Travis Oliphant
On May 14, 2012, at 7:07 PM, Stéfan van der Walt wrote: Hi Zach On Mon, May 14, 2012 at 4:33 PM, Zachary Pincus zachary.pin...@yale.edu wrote: The below seems to be a bug, but perhaps it's unavoidably part of the indexing mechanism? It's easiest to show via example... note that using