mean¶
- sofia_redux.scan.utilities.numba_functions.mean(values, weights=None, start=0, end=-1)[source]¶
Return the (optionally weighted) mean value of an array.
NaN and zero weighted values are not included in the calculation. All arrays must be one dimensional.
- Parameters:
- valuesnumpy.ndarray (float)
An array of values with shape (n,).
- weightsnumpy.ndarray (float), optional
An array of weights with shape (n,).
- startint, optional
The inclusive start index of the values included in the mean calculation. The default is the first value (0).
- endint, optional
The non-inclusive end index for the values included in the mean calculation. Negative values are wrapped to values.size + 1 + end. The default is the last value (-1).
- Returns:
- mean, weightfloat, float
The mean value and weight sum.