[SciPy-user] Sparse matrix: division by vector
Tue Apr 29 18:41:07 CDT 2008
On Tue, Apr 29, 2008 at 6:05 PM, Anne Archibald
> Is there any way to make the OP's approach work? Or even A /=
There is backend support for this operation in sparsetools for CSR,CSC
and BSR matrices. I occasionally use it directly, but I haven't
exposed it through SciPy yet.
Ideally sparse would expose this in a manner consistent with numpy matrices.
A safer approach is to use a diagonal matrix (e.g. D = spdiags(....))
to rescale rows or columns. With this approach, you don't need to
worry whether the matrix is dense or sparse (or in which format it is
> This seems like a basic expectation from sparse
> matrices... Is there a document describing which basic numpy
> operations work on sparse matrices and which don't?
Nathan Bell email@example.com
More information about the SciPy-user