Compute the q-th quantile of the data along the specified axis. .. versionadded:: 1.15.0 Parameters ---------- a : array_like of real numbers Input array or object that can be converted to an array. q : array_like of float Probability or sequence of probabi
(a,
q,
axis=None,
out=None,
overwrite_input=False,
method="linear",
keepdims=False,
*,
interpolation=None)
| 4291 | |
| 4292 | @array_function_dispatch(_quantile_dispatcher) |
| 4293 | def quantile(a, |
| 4294 | q, |
| 4295 | axis=None, |
| 4296 | out=None, |
| 4297 | overwrite_input=False, |
| 4298 | method="linear", |
| 4299 | keepdims=False, |
| 4300 | *, |
| 4301 | interpolation=None): |
| 4302 | """ |
| 4303 | Compute the q-th quantile of the data along the specified axis. |
| 4304 | |
| 4305 | .. versionadded:: 1.15.0 |
| 4306 | |
| 4307 | Parameters |
| 4308 | ---------- |
| 4309 | a : array_like of real numbers |
| 4310 | Input array or object that can be converted to an array. |
| 4311 | q : array_like of float |
| 4312 | Probability or sequence of probabilities for the quantiles to compute. |
| 4313 | Values must be between 0 and 1 inclusive. |
| 4314 | axis : {int, tuple of int, None}, optional |
| 4315 | Axis or axes along which the quantiles are computed. The default is |
| 4316 | to compute the quantile(s) along a flattened version of the array. |
| 4317 | out : ndarray, optional |
| 4318 | Alternative output array in which to place the result. It must have |
| 4319 | the same shape and buffer length as the expected output, but the |
| 4320 | type (of the output) will be cast if necessary. |
| 4321 | overwrite_input : bool, optional |
| 4322 | If True, then allow the input array `a` to be modified by |
| 4323 | intermediate calculations, to save memory. In this case, the |
| 4324 | contents of the input `a` after this function completes is |
| 4325 | undefined. |
| 4326 | method : str, optional |
| 4327 | This parameter specifies the method to use for estimating the |
| 4328 | quantile. There are many different methods, some unique to NumPy. |
| 4329 | See the notes for explanation. The options sorted by their R type |
| 4330 | as summarized in the H&F paper [1]_ are: |
| 4331 | |
| 4332 | 1. 'inverted_cdf' |
| 4333 | 2. 'averaged_inverted_cdf' |
| 4334 | 3. 'closest_observation' |
| 4335 | 4. 'interpolated_inverted_cdf' |
| 4336 | 5. 'hazen' |
| 4337 | 6. 'weibull' |
| 4338 | 7. 'linear' (default) |
| 4339 | 8. 'median_unbiased' |
| 4340 | 9. 'normal_unbiased' |
| 4341 | |
| 4342 | The first three methods are discontinuous. NumPy further defines the |
| 4343 | following discontinuous variations of the default 'linear' (7.) option: |
| 4344 | |
| 4345 | * 'lower' |
| 4346 | * 'higher', |
| 4347 | * 'midpoint' |
| 4348 | * 'nearest' |
| 4349 | |
| 4350 | .. versionchanged:: 1.22.0 |
nothing calls this directly
no test coverage detected