acidbase.geometric_mean¶
- acidbase.geometric_mean(x: ndarray, *, remove_na: bool = True, zero_propagate: bool = False) float¶
Compute the geometric mean.
- Parameters:
x (array-like) – Numeric vector.
remove_na (bool) – If
True(default),NA/NaNvalues are removed before computing.zero_propagate (bool) – If
True, return0when any element is zero. IfFalse(default), zeros are excluded before computing, but the full length ofx(including zeros) is used as the denominator — matching R’sgeometricMeandefault.
- Returns:
Geometric mean of
x.- Return type:
Notes
Returns
NaNwhen any element is negative (R semantics).