scipy.stats.mstats.threshold(a, threshmin=None, threshmax=None, newval=0)[source]

Clip array to a given value.

Similar to numpy.clip(), except that values less than threshmin or greater than threshmax are replaced by newval, instead of by threshmin and threshmax respectively.

Parameters :

a : ndarray

Input data

threshmin : {None, float} optional

Lower threshold. If None, set to the minimum value.

threshmax : {None, float} optional

Upper threshold. If None, set to the maximum value.

newval : {0, float} optional

Value outside the thresholds.

Returns :

a, with values less (greater) than threshmin (threshmax) replaced with newval. :

Previous topic


Next topic