I was trying to create a sparse matrix using scipy.sparse (100000 X
100000) with just the first row and first column filled with ones.
Lets call this matrix Asp. This is how I created Asp

from scipy import sparse
Asp = scipy.lil_matrix(100000,100000)
for i in range(100000):
   Asp[i,0] = i
   Asp[0,i] = i
Bsp = (Asp.tocsr())*(Asp.tocsr())

This multiplication to get Bsp is taking a long time (to the order of
over an hour). Is there some other way of storing such huge sparse
matrices and doing their multiplications or is this the most optimal
way?
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to