[Numpy-discussion] What's wrong with matrices?

Ed Schofield schofield at ftw.at
Fri Jul 7 08:49:41 CDT 2006


Bill Baxter wrote:
> I think the thread to this point can be pretty much summarized by:
>
> while True:
>     Bill: "2D transpose is common so it should have a nice syntax"
>     Tim, Robert, Sasha, and Ed: "No it's not."
>
> Very well.  I think it may be a self fulfilling prophecy, though. 
> I.e. if matrix operations are cumbersome to use, then -- surprise
> surprise -- the large user base for matrix-like operations never
> materializes.  Potential converts just give numpy the pass, and go to
> Octave or Scilab, or stick with Matlab, R or S instead. 
>
> Why all the fuss about the .T?  Because any changes to functions (like
> making ones() return a matrix) can easily be worked around on the user
> side, as has been pointed out.  But as far as I know -- do correct me
> if I'm wrong -- there's no good way for a user to add an attribute to
> an existing class.  After switching from matrices back to arrays, .T
> was the only thing I really missed from numpy.matrix.
>
> I would be all for a matrix class that was on equal footing with array
> and as easy to use as matrices in Matlab.  But my experience using
> numpy.matrix was far from that, and, given the lack of enthusiasm for
> matrices around here, that seems unlikely to change.  However, I'm
> anxious to see what Ed has up his sleeves in the other thread.

Okay ... <Ed rolls up his sleeves> ... let's make this the thread ;) 
I'd like to know why you, Sven, and anyone else on the list have gone
back to using arrays after trying matrices.  What was inconvenient about
them?  I'd like a nice juicy list.  The whole purpose of the matrix
class is to simplify 2d linear algebra.  Where is it failing?

I also went back to arrays after trying out matrices for some 2d linear
algebra tasks, since I found that using matrices increased my code's
complexity.  I can describe the problems I had with them later, but
first I'd like to hear of others' experiences.

I'd like to help to make matrices more usable.  Tell me what you want,
and I'll work on some patches.

-- Ed




More information about the Numpy-discussion mailing list