[Numpy-discussion] untenable matrix behavior in SVN

Alan G Isaac aisaac@american....
Fri Apr 25 12:04:53 CDT 2008


> 2008/4/25 Alan G Isaac <aisaac@american.edu>:
>>  I must have misunderstood:
>>  I thought the agreement was to
>>  provisionally return a 1d array for x[0],
>>  while we hashed through the other proposals.

On Fri, 25 Apr 2008, Stéfan van der Walt apparently wrote:
> The agreement was:
> a) That x[0][0] should be equal to x[0,0] and 
> b) That x[0,:] should be equal to x[0] (as for ndarrays)

1. This is **not** what I understood as the agreement
(and I think the current solution is bad).
I certainly did not mean to support the change that
as implemented, and it is not clear to me that others
did either.

2. These two goals are substantially in conflict for 
matrices, as we are seeing.

3. The important goal, (goal a., which everyone agrees on),
has NOT been accomplished by the current change:
x[0][0] raises a TypeError when x is a 1 by N matrix.


> This breaks as little functionality as possible, at the 
> cost of one (instead of two) API changes. 

I cannot agree with this assessment.

> the current situation is not tenable. 

I agree with this!  Better than the SVN behavior would be to 
raise an error in response to scalar indexing of matrices.
I strongly hope that this behavior will not show up in 
a release!

Please return 1d arrays in response to scalar
indexing as the provisional arrangement.
This is certainly better than the new behavior.

Alan Isaac





More information about the Numpy-discussion mailing list