user566621
user566621

Reputation: 239

Is there support for sparse matrices in Python?

Is there support for sparse matrices in python?

Possibly in numpy or in scipy?

Upvotes: 23

Views: 28223

Answers (2)

Steve Tjoa
Steve Tjoa

Reputation: 61044

Yes.

SciPi provides scipy.sparse, a "2-D sparse matrix package for numeric data".

There are seven available sparse matrix types:

  1. csc_matrix: Compressed Sparse Column format
  2. csr_matrix: Compressed Sparse Row format
  3. bsr_matrix: Block Sparse Row format
  4. lil_matrix: List of Lists format
  5. dok_matrix: Dictionary of Keys format
  6. coo_matrix: COOrdinate format (aka IJV, triplet format)
  7. dia_matrix: DIAgonal format

Upvotes: 41

kros
kros

Reputation: 1257

  1. CVXOPT - Sparse matrices

  2. Pysparse

Upvotes: 5

Related Questions