sparse matrix representation?

Neil Schemenauer nascheme at enme.ucalgary.ca
Sat Oct 23 14:08:42 EDT 1999


Patrick Tufts <zippy at cs.brandeis.edu> wrote:
>I want to work with 50k x 50k matrices with mostly zeroes, so a hash
>would be the efficient way to represent this.
>
>Does the Python numerical library handle large sparse matrices as
>hashes?

No.  You could use dictionaries.  A wrapper class could make them
appear as arrays.

>If not, is there a Python library that does?

I have a extension module that wraps the Sparse1.3 library.  I
don't think is has been well tested by anyone besides me so
please let me know about any problems you find.

    http://www.ucalgary.ca/~nascheme/python/sparsemodule-0.2.tar.gz

If you are on Windows and don't have a compiler, I can make a
.pyd file for you.


    Neil




More information about the Python-list mailing list