Which sparse matrix package?

MRAB google at mrabarnett.plus.com
Thu Dec 18 17:52:11 EST 2008


James Mills wrote:
> On Fri, Dec 19, 2008 at 8:18 AM, Martin Manns <mmanns at gmx.net> wrote:
>> Hi:
> 
> Hi,
> 
>> I am writing a spreadsheet application in Python
> 
> What's wrong with pyspread ?
> 
> [ ... snip ... ]
> 
>> The dict that I tried out is of the type:
>>
>> {(1,2,3): "2323", (1,2,545): "2324234", ... }
>>
>> It is too slow for my application when it grows. One slicing operation
>> with list comprehensions takes about 1/2 s on my computer for 1E6
>> elements.
> 
> Let me get this straight.
> It's taking 0.5s to slice your matrix
> of 1E7 (10000000.0 rows/columns)
> 
> Are you mad ? This is TEN Millions and you
> required it faster than 0.5s ?
> 
No, 1E6, or ONLY 1 million. :-)

> Am I missing something here ?
> 
Would a matrix of matrices work better, ie a supermatrix where each 
element is either a submatrix of cells or None if the submatrix is 
empty? How much memory it would save would depend on how sparse the 
matrix is.



More information about the Python-list mailing list