scipy.stats.mstats.

trimtail#

scipy.stats.mstats.trimtail(data, proportiontocut=0.2, tail='left', inclusive=(True, True), axis=None)[source]#

Trims the data by masking values from one tail.

Deprecated since version 2.0.0: scipy.stats.mstats.trimtail is deprecated as of SciPy 2.0.0 and will be removed, along with the scipy.stats.mstats namespace, in SciPy 2.4.0. SciPy offers no replacement for this function. See the Trimming and winsorization transition guide for alternatives.

Parameters:
dataarray_like

Data to trim.

proportiontocutfloat, optional

Percentage of trimming. If n is the number of unmasked values before trimming, the number of values after trimming is (1 - proportiontocut) * n. Default is 0.2.

tail{‘left’,’right’}, optional

If ‘left’ the proportiontocut lowest values will be masked. If ‘right’ the proportiontocut highest values will be masked. Default is ‘left’.

inclusive{(bool, bool) tuple}, optional

Tuple indicating whether the number of data being masked on each side should be rounded (True) or truncated (False). Default is (True, True).

axisint, optional

Axis along which to perform the trimming. If None, the input array is first flattened. Default is None.

Returns:
trimtailndarray

Returned array of same shape as data with masked tail values.