skued.trimr

skued.trimr(array, percentile, axis=None, fill_value=0)

Trim values in an array that fall above (i.e. to the right) a certain percentile.

Parameters:
  • array (~numpy.ndarray) – Array to be trimmed, typically an image.

  • percentile (float in range [0, 100]) – Percentile above which array elements are set to fill_value.

  • axis (int or None, optional) – Axis along which to trim data. If None (default), compute over the whole array.

  • fill_value (float, optional) – Trimmed array elements are replaced with this value.

Returns:

trimmed – Trimmed array of the same shape as array.

Return type:

~numpy.ndarray

See also

triml

trim values in percentiles below a specific percentile.