### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.9 Reference Guide (DRAFT) »
- Statistical functions (`scipy.stats`) »
- Statistical functions for masked arrays (`scipy.stats.mstats`) »

# scipy.stats.mstats.threshold

`scipy.stats.mstats.``threshold`(a, threshmin=None, threshmax=None, newval=0)

  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. :

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.9 Reference Guide (DRAFT) »
- Statistical functions (`scipy.stats`) »
- Statistical functions for masked arrays (`scipy.stats.mstats`) »