This is documentation for an old release of NumPy (version 1.6.0). Read this page in the documentation of the latest stable release (version > 1.17).
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