From: <lu...@o2...> - 2009-09-04 12:50:57
|
Jose Blanca <jb...@bt...> writes: > Hi: > I'm new to pyparse, thanks for doing this tool open source. > I'm trying to store an sparse vector and to get the results. My requirements > a quite simple I just need to store some items and to get them at the end of > the analysis. > I've created the matrix with: > vect = pysparse.spmatrix.ll_mat(nelements, 1, size_hint) > > And now I want to get the items from the matrix. I could do: > items = vect.items() Not exactly what you ask, but you may try values, rows, cols = vect.find() which returns numpy arrays instead of tuples. > > The problem is that the created items is a list not an iterator. That consumes > a lot of extra memory just to access the matrix. Is this the expected > behaviour or am I missing something? > Best Regards, |