[Numpy-discussion] untenable matrix behavior in SVN
Alan G Isaac
Fri Apr 25 12:04:53 CDT 2008
> 2008/4/25 Alan G Isaac <email@example.com>:
>> I must have misunderstood:
>> I thought the agreement was to
>> provisionally return a 1d array for x,
>> 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 should be equal to x[0,0] and
> b) That x[0,:] should be equal to x (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
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 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
Please return 1d arrays in response to scalar
indexing as the provisional arrangement.
This is certainly better than the new behavior.
More information about the Numpy-discussion