官方文档中关于CSC矩阵原文如下:
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.
原文翻译:第i列的相对应的行信息,存储在indices[indptr[i]:indptr[i+1]]中,且与行列想对应的值存在于 data[indptr[i]:indptr[i+1]]。
相对应的测试代码如下:
>>> indptr = np.array([0, 2, 3,