[Numpy-discussion] untenable matrix behavior in SVN

Charles R Harris charlesr.harris@gmail....
Tue Apr 29 01:39:29 CDT 2008


On Tue, Apr 29, 2008 at 12:20 AM, Alan G Isaac <aisaac@american.edu> wrote:

> On Mon, 28 Apr 2008, Christopher Barker apparently wrote:
> > I'm going to try to put down what I think are the key,
> > very simple, questions:
>
> For useful reference, these are now here:
> <URL:http://www.scipy.org/MatrixIndexing#guidelines>
>
> Cheers,
> Alan
>
>
May I add that if I edit defmatrix.py to act like an array for scalar
indexing, then the following works.

In [1]: a = matrix(eye(2))

In [2]: array([a,a])
Out[2]:
array([[[ 1.,  0.],
        [ 0.,  1.]],

       [[ 1.,  0.],
        [ 0.,  1.]]])

This generates an error with the current version of matrix and, frankly, I
am not going to be bothered going all through the numpy c sources to special
case matrices to fix that. Someone else can do it if they wish. There are
recursive routines that expect the dimensions to decrease on each call.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080429/579116b6/attachment.html 


More information about the Numpy-discussion mailing list