statsmodels.stats.robust_compare.trim_mean¶
-
statsmodels.stats.robust_compare.trim_mean(a, proportiontocut, axis=
0
)[source]¶ Return mean of array after trimming observations from both tails.
If proportiontocut = 0.1, slices off ‘leftmost’ and ‘rightmost’ 10% of scores. Slices off LESS if proportion results in a non-integer slice index (i.e., conservatively slices off proportiontocut ).
- Parameters:¶
- aarray_like
Input array
- proportiontocut
float
Fraction to cut off at each tail of the sorted observations.
- axis
int
orNone
Axis along which the trimmed means are computed. The default is axis=0. If axis is None then the trimmed mean will be computed for the flattened array.
- Returns:¶
- trim_mean
ndarray
Mean of trimmed array.
- trim_mean
Last update:
Nov 14, 2024