Tue Dec 4 05:05:14 CST 2007
I have "solved" the issue by writing
This fills up B correctly. However, this approach appears to be very
inefficient. (Obviously, I am using *much* larger values than 5.)
It seems that this inefficiency is not due to the conversion but due
to the filling up of B. This deduction is made based on the fact that
adding two lil matrices returns a csr matrix in only a fraction of the
time the above operation takes.
I am using this approach because I have a very large matrix A in
sparse format and I want to add a border (and extra row and column).
Any help would be appreciated.
On 30 Nov 2007, at 18:26, Giovanni Samaey wrote:
> Hello all,
> I have a basic question concerning lil_matrix slice assignments.
> The following code does not behave as intended :
> import scipy.sparse as S
> A = S.lil_matrix((5,5))
> B = S.lil_matrix((6,6))
> This returns 0 instead of the expected 5. Am I using the code
> incorrectly ?
> SciPy-user mailing list
More information about the SciPy-user