Is there support for sparse matrices in Python?

萝らか妹 提交于 2019-11-29 06:25:07

问题


Is there support for sparse matrices in python?

Possibly in numpy or in scipy?


回答1:


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



回答2:


  1. CVXOPT - Sparse matrices

  2. Pysparse



来源:https://stackoverflow.com/questions/4623800/is-there-support-for-sparse-matrices-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!