[Numpy-discussion] untenable matrix behavior in SVN
Alan G Isaac
Fri Apr 25 18:17:17 CDT 2008
>> On Fri, 25 Apr 2008, Christopher Barker apparently wrote:
>>> I think a Vector object would allow both of:
>>> M[i,j] == M[i][j]
>>> M[i] == M[i,:]
> On Fri, Apr 25, 2008 at 2:57 PM, Alan G Isaac
> <email@example.com> wrote:
>> The problem is that it would be a crime to give up
>> the natural production of submatrices. The NATURAL RULE
>> is: to get a submatrix, use nonscalar indices.
>> We should not give up that x[0,:] is a sub*matrix*
>> whose first element is x[0,0] and equivalently x.
>> This is why we must have x!=x[0,:] if we want,
>> as we do, that x==x[0,0].
On Fri, 25 Apr 2008, Charles R Harris apparently wrote:
> I would give it up and let x(0) be a submatrix, the normal
> indexing is then exactly like an array. True, the result
> of x(0) can't be used as an lvalue (only getitem
> equivalence), but otherwise it should work fine.
The "it" here is ambiguous.
Which do you want to give up?
- x==x[0,0] ?
the argument has been that this is a fundamental
expectations for 2d array-like objects, and
I think that argument is right
- x==x[0,:] ?
I believe you mean we should give this up,
and if so, I strongly agree. As you know.
Enforcing this is proving untenable and costly.
More information about the Numpy-discussion