triu
- sparse.triu(x, k=0)[source]
Returns an array with all elements below the k-th diagonal set to zero.
- Parameters:
- Returns:
The output upper-triangular matrix.
- Return type:
- Raises:
ValueError – If
x
doesn’t have zero fill-values.
See also
numpy.triu
NumPy equivalent function