Python中是否支持稀疏矩阵? [英] Is there support for sparse matrices in Python?

查看:69
本文介绍了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:

  1. csc_matrix:压缩的稀疏列格式
  2. csr_matrix:压缩的稀疏行格式
  3. bsr_matrix:稀疏行格式
  4. lil_matrix:列表格式列表
  5. dok_matrix:键字典格式
  6. coo_matrix:COOrdinate格式(又名IJV,三元组格式)
  7. dia_matrix:对角格式
  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

这篇关于Python中是否支持稀疏矩阵?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆