eelbrain.NDVar.var¶
-
NDVar.
var
(dims=(), ddof=0, **regions)¶ Compute the variance over given dimensions
- Parameters
dims (str | tuple of str | boolean NDVar) – Dimensions over which to operate. A str is used to specify a single dimension, a tuple of str to specify several dimensions, None to compute the sum over all dimensions. An boolean NDVar with the same dimensions as the data can be used to compute the variance in specific elements (if the data has a case dimension, the variance is computed for each case).
ddof (int) – Degrees of freedom (default 0; see
numpy.var()
).name (str) – Name of the output NDVar (default is the current name).
**regions – Regions over which to aggregate. For example, to get the variance between time=0.1 and time=0.2, use
ndvar.var(time=(0.1, 0.2))
.
- Returns
var – The variance over specified dimensions. Return a Var if only the case dimension remains, and a float if the function collapses over all data.
- Return type
NDVar | Var | float