[SciPy-User] how to obtain I, J, V from sparse matrix (V, (I, J)) ?

Jose Borreguero borreguero at gmail.com
Tue Mar 20 18:47:49 EDT 2012


Thank you. I was working with csr_matrix which lacks row and col
attributes. I'll just cast to coo_matrix.
-Jose



On Tue, Mar 20, 2012 at 5:55 PM, Pauli Virtanen <pav at iki.fi> wrote:

> 20.03.2012 22:08, Jose Borreguero kirjoitti:
> > Scipy docs state one can construct a matrix from three 1D
> > arrays,A=sparse.coo_matrix((V,(I,J)),shape=(4,4))
> >
> > However, given sparse matrix A, how can I obtain arrays V, I, and J?
> > I could not find any methods of the sparse matrix that would return
> these arrays...
>
> Check out the `data`, `row` and `col` attributes:
>
>
> http://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.coo_matrix.html
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20120320/44506d9e/attachment.html>


More information about the SciPy-User mailing list