SciPy
csr_matrix.trace
Returns the sum along diagonals of the sparse array/matrix.
Which diagonal to get, corresponding to elements a[i, i+offset]. Default: 0 (the main diagonal).
previous
scipy.sparse.csr_matrix.tolil
next
scipy.sparse.csr_matrix.transpose