NumPy

Previous topic

numpy.ma.MaskedArray.compress

Next topic

numpy.ma.MaskedArray.fill

This is documentation for an old release of NumPy (version 1.19). Read this page in the documentation of the latest stable release (version 2.2).

numpy.ma.MaskedArray.diagonal

method

MaskedArray.diagonal(offset=0, axis1=0, axis2=1)[source]

Return specified diagonals. In NumPy 1.9 the returned array is a read-only view instead of a copy as in previous NumPy versions. In a future version the read-only restriction will be removed.

Refer to numpy.diagonal for full documentation.

See also

numpy.diagonal

equivalent function