bandhic.band_hic_matrix.diag#

band_hic_matrix.diag(k)[source]#

Retrieve the k-th diagonal from the matrix.

Parameters:

k (int) – The diagonal index to retrieve.

Returns:

The k-th diagonal values; masked if mask is set.

Return type:

ndarray or MaskedArray

Examples

>>> import bandhic as bh
>>> mat = bh.ones((3,3), diag_num=2)
>>> mat.diag(1)
array([1., 1.])