### Navigation

- index
- modules |
- modules |
- next |
- previous |
- NumPy v1.7 Manual (DRAFT) »
- NumPy Reference »
- Routines »
- Masked array operations »

# numpy.ma.diag

`numpy.ma.``diag`(v, k=0)

  Extract a diagonal or construct a diagonal array.

  This function is the equivalent of `numpy.diag` that takes masked values into account, see `numpy.diag` for details.

  See also

  `numpy.diag`
    Equivalent function for ndarrays.

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- NumPy v1.7 Manual (DRAFT) »
- NumPy Reference »
- Routines »
- Masked array operations »