SciPy

scipy.stats.mstats.trima

scipy.stats.mstats.trima(a, limits=None, inclusive=(True, True))[source]

Trims an array by masking the data outside some given limits. Returns a masked version of the input array.

Parameters:

a : sequence

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 : {(True,True) tuple}, optional

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