Back to Numerical Arrays (NumPy)
np.trace
Return the sum along diagonals of the array.
Syntax
np.trace(a, offset?, axis1?, axis2?)
Description
Return the sum along diagonals of the array.
Parameters
| Name | Description |
|---|---|
| a | NDArray |
| offset(optional) | number |
| axis1(optional) | number |
| axis2(optional) | number |
Returns
Promise<number>