SciPy

scipy.sparse.csr_matrix.sorted_indices

csr_matrix.sorted_indices()[source]

Return a copy of this matrix with sorted indices