[SciPy-user] change in matrix behavior

Alan G Isaac aisaac@american....
Thu May 8 16:46:33 CDT 2008


On Thu, 8 May 2008, Nathan Bell apparently wrote:
> why don't we deprecate numpy.matrix?  Clearly no one here 
> uses it and it is a major pain to handle correctly in 
> SciPy. 

I have a rather different perspective.

I have switched to using Python in teaching.  In my field 
(economics), students are often familiar with matrices, 
which are extensively used by economists and 
econometricians.  The availability of NumPy matrices is 
a key reason I am able to switch to Python for these 
courses.  I think economics is not unique, and looking 
forward, this kind of teaching use of NumPy matrices will 
become quite common.

I also personally find NumPy matrices convenient when doing 
linear algebra.

Cheers,
Alan Isaac

PS I think the current change will render matrices more 
usable for two reasons.  First, it is natural that iteration  
over a matrix produce 1d object, for reasons you can find in 
the NumPy discussion threads.  Second and related, matrices 
will be handled correctly by functions that rely on 
dimension reducing iterations.  Finally, I expect something 
like ``rows`` and ``cols`` attributes to be added, which 
will add a natural, explicit, and symmetric iterative access 
to these submatrices.




More information about the SciPy-user mailing list