[Numpy-discussion] untenable matrix behavior in SVN

Charles R Harris charlesr.harris@gmail....
Fri Apr 25 14:07:17 CDT 2008


On Fri, Apr 25, 2008 at 12:02 PM, Alan G Isaac <aisaac@american.edu> wrote:

> On Fri, 25 Apr 2008, Stéfan van der Walt apparently wrote:
> > Reverted in r5084.
>
> Thank you.
>
> I think we have discovered that there is a basic conflict
> between two behaviors:
>
>        x[0] == x[0,:]
>        vs.
>         x[0][0] == x[0,0]
>
> To my recollection, everyone has agree that the second
> behavior is desirable as a *basic expectation* about the
> behavior of 2d objects.  This implies that *eventually* we
> will have ``x[0][0] == x[0,0]``.  But then eventually
> we MUST eventually have x[0] != x[0,:].
>
Choices:

1) x[0] equiv x[0:1,:] -- current behavior
2) x[0] equiv x[0,:] -- array behavior, gives x[0][0] == x[0,0]

These are incompatible. I think 1) is more convenient in the matrix domain
and should be kept, while 2) should be given up. What is the reason for
wanting 2)? Maybe we could overload the () operator so that x(0) gives 2)?
Or vice versa.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080425/5fd43547/attachment.html 


More information about the Numpy-discussion mailing list