Returns the upper triangular part of a 2-D array, setting elements below the specified diagonal to zero.
Arguments
- x
(
arrayish)
Input array.- diagonal
(
integer(1))
Diagonal offset.0(default) is the main diagonal, positive values exclude diagonals above, negative values include diagonals below.
Value
arrayish
Has the same shape and data type as x.