Python中是否支持稀疏矩阵? [英] Is there support for sparse matrices in Python?
本文介绍了Python中是否支持稀疏矩阵?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在python中是否支持稀疏矩阵?
Is there support for sparse matrices in python?
可能是numpy还是scipy?
Possibly in numpy or in scipy?
推荐答案
是.
SciPi提供 scipy.sparse ,即二维稀疏"用于数字数据的矩阵包".
SciPi provides scipy.sparse, a "2-D sparse matrix package for numeric data".
有7种可用的稀疏矩阵类型:
There are seven available sparse matrix types:
- csc_matrix:压缩的稀疏列格式
- csr_matrix:压缩的稀疏行格式
- bsr_matrix:稀疏行格式
- lil_matrix:列表格式列表
- dok_matrix:键字典格式
- coo_matrix:COOrdinate格式(又名IJV,三元组格式)
- dia_matrix:对角格式
- csc_matrix: Compressed Sparse Column format
- csr_matrix: Compressed Sparse Row format
- bsr_matrix: Block Sparse Row format
- lil_matrix: List of Lists format
- dok_matrix: Dictionary of Keys format
- coo_matrix: COOrdinate format (aka IJV, triplet format)
- dia_matrix: DIAgonal format
这篇关于Python中是否支持稀疏矩阵?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文