Skip to content

Issue on page /02_linear_algebra/sparse.html #36

@alugowski

Description

@alugowski

Great book! I learned a lot!

One note about this section: https://caam37830.github.io/book/02_linear_algebra/sparse.html#saving-and-loading-sparse-matrices

It says to load a Matrix Market file manually using NumPy's genfromtxt then reconstructing the triplets. It's probably better to introduce scipy.io.mmread which can read this format directly into a coo_matrix.

Note that a .mtx file can have anywhere from 1 to 4 columns (from dense array to coordinate complex) so the genfromtxt approach can be fragile.

For very large matrices I can selfishly recommend the fast_matrix_market package: https://pypi.org/project/fast-matrix-market/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions