scipy.sparse.lil_eye

scipy.sparse.lil_eye((r, c), k=0, dtype='d')

Generate a lil_matrix of dimensions (r,c) with the k-th diagonal set to 1.

Parameters :

r,c : int

row and column-dimensions of the output.

k : int

  • diagonal offset. In the output matrix,
  • out[m,m+k] == 1 for all m.

dtype : dtype

data-type of the output array.

Previous topic

scipy.sparse.kronsum

Next topic

scipy.sparse.lil_diags

This Page