[SciPy-User] fancy indexing lil_matrix extremely slow

Cplusplus Programmer programmercplusplus at yahoo.com
Tue Dec 25 11:16:49 EST 2012


Hello All,

I am using scipy version 0.9. I have a sparse matrix, of which I do not know beforehand what values it will get.
What I did was first generating a scipy.sparse.lil_matrix of zeros (N x N matrix).

To assign values to the sparse matrix I use fancy slicing e.g

for i in range( N ):
    myLilMatrix[ 0: N-4, i ] = myArrayWithValuesToAssign

I works fine, however, it is very very slow. I could not use other sparse matrix types, since those does not support fancy indexing for assignment. I was wondering if there is a way to speed up sparse matrix assignements ?

If scipy.sparse module does not support this, does anyone know another module which will be faster ?

regards,

pcpp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20121225/c3b5855d/attachment.html>


More information about the SciPy-User mailing list