cupy.percentile

cupy.percentile(a, q, axis=None, out=None, *, method='linear', keepdims=False, interpolation=None)[source]

Computes the q-th percentile of the data along the specified axis.

Parameters
  • a (cupy.ndarray) – Array for which to compute percentiles.

  • q (float, tuple of floats or cupy.ndarray) – Percentiles to compute in the range between 0 and 100 inclusive.

  • axis (int or tuple of ints) – Along which axis or axes to compute the percentiles. The flattened array is used by default.

  • out (cupy.ndarray) – Output array.

  • method (str) – Interpolation method when a quantile lies between two data points. linear interpolation is used by default. Supported interpolations are``lower``, higher, midpoint, nearest and linear.

  • keepdims (bool) – If True, the axis is remained as an axis of size one.

  • interpolation (str) – Deprecated name for the method keyword argument.

Returns

The percentiles of a, along the axis if specified.

Return type

cupy.ndarray