首页 > 其他 > 详细

scipy csr_matrix和csc_matrix函数详解

时间:2021-09-06 21:53:20      阅读:18      评论:0      收藏:0      [点我收藏+]

[链接]:scipy csr_matrix和csc_matrix函数详解_Sundrops的专栏-CSDN博客_csc_matrix

概述
在用python进行科学运算时,常常需要把一个稀疏的np.array压缩,这时候就用到scipy库中的sparse.csr_matrix(csr:Compressed Sparse Row marix) 和sparse.csc_matric(csc:Compressed Sparse Column marix)

scipy.sparse.csr_matrix
官方API介绍(省略前几种容易理解的了)
csr_matrix((data, indices, indptr), [shape=(M, N)])
is the standard CSR representation where the column indices for row i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. If the shape parameter is not supplied, the matrix dimensions are inferred from the index arrays.

技术分享图片

 

官方API介绍(省略前几种容易理解的了)

csc_matrix((data, indices, indptr), [shape=(M, N)])
is the standard CSC representation where the row indices for column i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]]. If the shape parameter is not supplied, the matrix dimensions are inferred from the index arrays.

技术分享图片

 

 



scipy csr_matrix和csc_matrix函数详解

原文:https://www.cnblogs.com/huixinquan/p/15233477.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!