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.

参见

numpy.diag
Equivalent function for ndarrays.