Question: what is indptr in csr?
Answer: CSR Matrix indptr can be thought of as giving the slice which must be applied to the other attribute in order to get each row of the matrix. In other words, slice(indptr[i], indptr[i+1]) corresponds to the slice needed to find the i-th row of the matrix in the data and indices fields.