[Numpy-discussion] untenable matrix behavior in SVN
Charles R Harris
charlesr.harris@gmail....
Fri Apr 25 16:43:29 CDT 2008
On Fri, Apr 25, 2008 at 2:57 PM, Alan G Isaac <aisaac@american.edu> 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[0][0].
> *This* is why we must have x[0]!=x[0,:] if we want,
> as we do, that x[0][0]==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.
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080425/5a6fe601/attachment.html
More information about the Numpy-discussion
mailing list