# triu¶

sparse.triu(x, k=0)[source]

Returns an array with all elements below the k-th diagonal set to zero.

Parameters: x (COO) – The input array. k (int, optional) – The diagonal below which elements are set to zero. The default is zero, which corresponds to the main diagonal. The output upper-triangular matrix. COO ValueError – If x doesn’t have zero fill-values.

numpy.triu()