[SciPy-User] fancy indexing lil_matrix extremely slow
Tue Dec 25 10:27:42 CST 2012
It sounds like you would be better served using a COO matrix constructor
instead of LIL (
>From your example code, you don't actually need slicing.
On Tue, Dec 25, 2012 at 5:16 PM, Cplusplus Programmer <
> 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
> 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 ?
> SciPy-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User