remove_diag

Contents

remove_diag#

class saiunit.math.remove_diag(x, **kwargs)#

Remove the diagonal of the matrix.

Parameters:

x (Array | ndarray | bool | number | bool | int | float | complex | saiunit.Quantity) – The matrix with the shape of (M, N).

Returns:

arr – The matrix without diagonal which has the shape of (M, N-1).

Return type:

Array | saiunit.Quantity

Examples

>>> import saiunit as u
>>> a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] * u.second
>>> u.math.remove_diag(a)