NumPy

numpy.ma.MaskType.diagonal

method

MaskType.diagonal()

Scalar method identical to the corresponding array attribute.

Please see ndarray.diagonal.