numpy.ma.trace — NumPy v2.6.dev0 Manual

ma.trace(self, offset=0, axis1=0, axis2=1, dtype=None, out=None)a.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None)

[source]

#

ma.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None)→

None

Return the sum along diagonals of the array.

Refer to

numpy.trace

for full documentation.