sparse.csr_matrix
1 | from scipy import sparse |
1 | matrix([[1, 0, 2], |
data:所有非零数值indptr:每行的非零数据 data[i:i+1] : 相当于每行的非零数值的个数, 把data的值做分组, 每组的开头结尾索引indices:所有值的列索引
1 | from scipy import sparse |
1 | matrix([[1, 0, 2], |
data:所有非零数值indptr:每行的非零数据 data[i:i+1] : 相当于每行的非零数值的个数, 把data的值做分组, 每组的开头结尾索引indices:所有值的列索引