[Numpy-discussion] Matlab page on scipy wiki

Sven Schreiber svetosch at gmx.net
Fri Feb 10 03:36:02 CST 2006

Fernando Perez schrieb:
> Bill Baxter wrote:
>> For what it's worth, matlab's rank function just calls svd, and
>> returns the
>> number singular values greater than a tolerance.  The implementation is a
>> whopping 5 lines long.
> Yup, and it would be pretty much the same 5 lines in numpy, with the
> same semantics.
> Here's a quick and dirty implementation for old-scipy (I don't have
> new-scipy on this box):

Is there any reason not to use the algorithm implicit in lstsq, as in:
rk = linalg.lstsq(M, ones(p))[2]

(where M is the matrix to check, and p==M.shape[0])


More information about the Numpy-discussion mailing list