### Navigation

- index
- modules |
- modules |
- SciPy v0.9 Reference Guide (DRAFT) »

# scipy.sparse.lil_matrix.setdiag

`lil_matrix.``setdiag`(values, k=0)

  Fills the diagonal elements {a_ii} with the values from the given sequence. If k != 0, fills the off-diagonal elements {a_{i,i+k}} instead.

  values may have any length. If the diagonal is longer than values, then the remaining diagonal entries will not be set. If values if longer than the diagonal, then the remaining values are ignored.

### Navigation

- index
- modules |
- modules |
- SciPy v0.9 Reference Guide (DRAFT) »