bandhic.band_hic_matrix.var#
- band_hic_matrix.var(axis=None)[source]#
Compute the variance of the values in the matrix or along a given axis.
- Parameters:
axis (None, int, or {'row','col','diag'}, optional) –
Axis along which to compute the variance:
None: variance over all stored values (and default for missing).
0 or ‘row’: per-row reduction.
1 or ‘col’: per-column reduction.
’diag’: per-diagonal reduction.
Default is None.
- Returns:
Variance(s) along the specified axis.
- Return type:
scalar or ndarray
- Raises:
ValueError – If axis is not one of the supported values.
Examples
>>> import bandhic as bh >>> mat = bh.band_hic_matrix(np.arange(9).reshape(3,3), diag_num=2) >>> mat.var() # variance of all elements 7.555555555555555 >>> mat.var(axis='row') array([ 0.22222222, 2.88888889, 10.88888889])