[Numpy-discussion] untenable matrix behavior in SVN
Charles R Harris
Fri Apr 25 16:43:29 CDT 2008
On Fri, Apr 25, 2008 at 2:57 PM, Alan G Isaac <firstname.lastname@example.org> wrote:
> On Fri, 25 Apr 2008, Christopher Barker apparently wrote:
> > I think a Vector object would allow both of:
> > M[i,j] == M[i][j]
> > and
> > M[i] == M[i,:]
> 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].
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion