{ } Raw JSON

bundles / scipy latest / scipy / stats / _mstats_basic / trima

function

scipy.stats._mstats_basic:trima

source: /scipy/stats/_mstats_basic.py :1864

Signature

def   trima ( a limits = None inclusive = (True, True) )

Summary

Trims an array by masking the data outside some given limits.

Extended Summary

Returns a masked version of the input array.

Parameters

a : array_like

Input array.

limits : {None, tuple}, optional

Tuple of (lower limit, upper limit) in absolute values. Values of the input array lower (greater) than the lower (upper) limit will be masked. A limit is None indicates an open interval.

inclusive : (bool, bool) tuple, optional

Tuple of (lower flag, upper flag), indicating whether values exactly equal to the lower (upper) limit are allowed.

Examples

from scipy.stats.mstats import trima
import numpy as np
a = np.arange(10)
The interval is left-closed and right-open, i.e., `[2, 8)`. Trim the array by keeping only values in the interval.
trima(a, limits=(2, 8), inclusive=(True, False))

Aliases

  • scipy.stats._mstats_basic.trima