[SciPy-dev] conversion among sparse formats

Nathan Bell wnbell@gmail....
Sat Dec 8 16:15:50 CST 2007


I added a todok() method and improved lil_matrix.tocsr() for following
results:

                   Sparse Matrix Conversion
====================================================================
format |  tocsr()  |  tocsc()  |  tocoo()  |  tolil()  |  todok()
--------------------------------------------------------------------
 csr   | 0.0000023 | 0.0002976 | 0.0003663 | 0.0066667 | 0.0078571
 csc   | 0.0003049 | 0.0000021 | 0.0003484 | 0.0073333 | 0.0083333
 coo   | 0.0004074 | 0.0003717 | 0.0000022 | 0.0071429 | 0.0076923
 lil   | 0.0016129 | 0.0021739 | 0.0021277 | 0.0000013 | 0.0090909
 dok   | 0.0019608 | 0.0019231 | 0.0015152 | 0.0090909 | 0.0000016

Conversions from dense matrices to lil_matrix and dok_matrix are much faster
also.

-- 
Nathan Bell wnbell@gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-dev/attachments/20071208/ba2b3395/attachment.html 


More information about the Scipy-dev mailing list