[Numpy-discussion] is it a bug?

Stéfan van der Walt stefan@sun.ac...
Fri Mar 13 01:00:30 CDT 2009


Hey Travis!

2009/3/13 Travis E. Oliphant <oliphant@enthought.com>:
> Referencing my previous post on this topic.   In this case, it is
> unambiguous to replace dimensions 1 and 2 with the result of
> broadcasting idx and idx together.   Thus the (5,6) dimensions is
> replaced by the (2,) result of indexing leaving the outer dimensions
> in-tact,  thus (4,2,7) is the result.
>
> I could be persuaded that this attempt to differentiate "unambiguous"
> from "ambiguous" sub-space replacements was mis-guided and we should
> have stuck with the simpler rule expressed above.    But, it seemed so
> aesthetically pleasing to swap-out the indexed sub-space when it was
> possible to do it.

Thank you for the explanation!  It makes sense, intuitively, it is
just hard to explain all these rules to newcomers.  It also makes it a
bit more difficult to tell a machine how to interpret the result of an
indexing operation.

Are we too far down the road to change this behaviour?  I guess some
code may already depend on it.

Have a great Friday,
Stéfan


More information about the Numpy-discussion mailing list