Re: [Numpy-discussion] matrix rank of numpy array or matrix

2008-02-05 Thread Nils Wagner
On Tue, 5 Feb 2008 11:37:12 -0800 (PST) mark <[EMAIL PROTECTED]> wrote: > Thanks. > I rewrote the line as: > > from numpy.linalg import svd > from numpy import sum,where > > def matrixrank(A,tol=1e-8): >s = svd(A,compute_uv=0) >return sum( where( s>tol, 1, 0 ) ) > > Would be nice to in

Re: [Numpy-discussion] matrix rank of numpy array or matrix

2008-02-05 Thread mark
Thanks. I rewrote the line as: from numpy.linalg import svd from numpy import sum,where def matrixrank(A,tol=1e-8): s = svd(A,compute_uv=0) return sum( where( s>tol, 1, 0 ) ) Would be nice to include matrixrank in numpy, as it is really useful, Thanks again, Mark On Feb 5, 7:59 pm, "Ni

Re: [Numpy-discussion] matrix rank of numpy array or matrix

2008-02-05 Thread Keith Goodman
On Feb 5, 2008 10:54 AM, mark <[EMAIL PROTECTED]> wrote: > Is there a function to compute the matrix rank of a numpy array or > matrix? I'm sure there's a more direct way, but numpy.linalg.lstsq returns the rank of a matrix. ___ Numpy-discussion mailing

Re: [Numpy-discussion] matrix rank of numpy array or matrix

2008-02-05 Thread Nils Wagner
On Tue, 5 Feb 2008 10:54:01 -0800 (PST) mark <[EMAIL PROTECTED]> wrote: > Hello - > > Is there a function to compute the matrix rank of a >numpy array or > matrix? > So I don't mean the current rank(), which gives the >number of > dimensions. > I mean the number of independent equations of a m

[Numpy-discussion] matrix rank of numpy array or matrix

2008-02-05 Thread mark
Hello - Is there a function to compute the matrix rank of a numpy array or matrix? So I don't mean the current rank(), which gives the number of dimensions. I mean the number of independent equations of a matrix. Thanks, Mark ___ Numpy-discussion maili