remove_diag

Contents

remove_diag#

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

Remove the diagonal of the matrix.

Parameters:

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

Returns:

arr – The matrix without diagonal which has the shape of (N, 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)