scipy.sparse.eye

scipy.sparse.eye(m, n, k=0, dtype='d', format=None)[source]

eye(m, n) returns a sparse (m x n) matrix where the k-th diagonal is all ones and everything else is zeros.

Previous topic

scipy.sparse.lil_matrix.transpose

Next topic

scipy.sparse.identity