[SciPy-user] more help with sparse matrix: creating

Robin robince@gmail....
Mon Oct 8 03:19:51 CDT 2007


I have to generate a large sparse matrix. I can't generate it all at once,
but I do know the number of nnz it will contain.

In MATLAB I first allocate the sparse matrix structure
A     = sparse([],[],1,dim,dim,Annz);
And then fill it at my leisure with normal slicing.

How would I achieve a similar thing in numpy (to first allocate with fixed
nnz, then fill in sections), preferably with slicing/fancy indexing?
(I was reading about lil_matrix etc. but it wasn't clear to me how to do the


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20071008/168ba96e/attachment.html 

More information about the SciPy-user mailing list