### Navigation

- index
- modules |
- next |
- previous |
- SciPy v0.7 Reference Guide (DRAFT) »
- Sparse matrices (`scipy.sparse`) »

# scipy.sparse.spdiags

`scipy.sparse.``spdiags`(data, diags, m, n, format=None)

  Return a sparse matrix from diagonals.

  Parameters: | data : array_like matrix diagonals stored row-wise diags : diagonals to set k = 0 the main diagonal k > 0 the k-th upper diagonal k < 0 the k-th lower diagonal m, n : int shape of the result format : format of the result (e.g. “csr”) By default (format=None) an appropriate sparse matrix format is returned. This choice is subject to change.

  See also

  `The`

### Navigation

- index
- modules |
- next |
- previous |
- SciPy v0.7 Reference Guide (DRAFT) »
- Sparse matrices (`scipy.sparse`) »