[Numpy-discussion] suggestions for Matrix-related changes

JJ josh8912 at yahoo.com
Tue Jul 11 20:23:28 EDT 2006


Travis Oliphant <oliphant <at> ee.byu.edu> writes:
 
> But, some kind of function that returns an array with specific 
> entries deleted would be nice.

I agree.  This would be just fine.


> We could over-ride the iterator 
> behavior of matrices, though to handle 1xn and nx1 matrices 
> identically if that is desirable.

I had tried this iteration on a month-old version of numpy and it did 
not work. I guess this now has been changed.  I just updated my copy but 
have not yet tried it.  An over-ride might be nice.  But just off the 
topic, could you get a matrix of real numbers such as A= [[1.0 2.0,3.0]]
to be used to select rows/colums as in B[:,A]?  I guess this would 
require a hidden conversion to integers, as well as code to handle 
selection using a matrix.


> Svd returns matrices now.  Except for the list of singular values 
> which is still an array.  Do you want a 1xn matrix instead of an 
> array?

I had just tried this with my new version of numpy, but I had used svd 
as follows:
import scipy.linalg as la
res = la.svd(M)
That returned arrays, but I see that using:
res = linalg.svd(M)
returns matrices.  Apparently, both numpy and scipy have linalg 
packages, which differ.  I did not know that.  Whoops.








More information about the NumPy-Discussion mailing list