Compute the q-th quantile of the data along the specified axis. 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 probabilities of the quantiles to com
(a,
q,
axis=None,
out=None,
overwrite_input=False,
method="linear",
keepdims=False,
*,
weights=None)
| 4266 | |
| 4267 | @array_function_dispatch(_quantile_dispatcher) |
| 4268 | def quantile(a, |
| 4269 | q, |
| 4270 | axis=None, |
| 4271 | out=None, |
| 4272 | overwrite_input=False, |
| 4273 | method="linear", |
| 4274 | keepdims=False, |
| 4275 | *, |
| 4276 | weights=None): |
| 4277 | """ |
| 4278 | Compute the q-th quantile of the data along the specified axis. |
| 4279 | |
| 4280 | Parameters |
| 4281 | ---------- |
| 4282 | a : array_like of real numbers |
| 4283 | Input array or object that can be converted to an array. |
| 4284 | q : array_like of float |
| 4285 | Probability or sequence of probabilities of the quantiles to compute. |
| 4286 | Values must be between 0 and 1 inclusive. |
| 4287 | axis : {int, tuple of int, None}, optional |
| 4288 | Axis or axes along which the quantiles are computed. The default is |
| 4289 | to compute the quantile(s) along a flattened version of the array. |
| 4290 | out : ndarray, optional |
| 4291 | Alternative output array in which to place the result. It must have |
| 4292 | the same shape and buffer length as the expected output, but the |
| 4293 | type (of the output) will be cast if necessary. |
| 4294 | overwrite_input : bool, optional |
| 4295 | If True, then allow the input array `a` to be modified by |
| 4296 | intermediate calculations, to save memory. In this case, the |
| 4297 | contents of the input `a` after this function completes is |
| 4298 | undefined. |
| 4299 | method : str, optional |
| 4300 | This parameter specifies the method to use for estimating the |
| 4301 | quantile. There are many different methods, some unique to NumPy. |
| 4302 | The recommended options, numbered as they appear in [1]_, are: |
| 4303 | |
| 4304 | 1. 'inverted_cdf' |
| 4305 | 2. 'averaged_inverted_cdf' |
| 4306 | 3. 'closest_observation' |
| 4307 | 4. 'interpolated_inverted_cdf' |
| 4308 | 5. 'hazen' |
| 4309 | 6. 'weibull' |
| 4310 | 7. 'linear' (default) |
| 4311 | 8. 'median_unbiased' |
| 4312 | 9. 'normal_unbiased' |
| 4313 | |
| 4314 | The first three methods are discontinuous. For backward compatibility |
| 4315 | with previous versions of NumPy, the following discontinuous variations |
| 4316 | of the default 'linear' (7.) option are available: |
| 4317 | |
| 4318 | * 'lower' |
| 4319 | * 'higher', |
| 4320 | * 'midpoint' |
| 4321 | * 'nearest' |
| 4322 | |
| 4323 | See Notes for details. |
| 4324 | |
| 4325 | .. versionchanged:: 1.22.0 |
nothing calls this directly
no test coverage detected
searching dependent graphs…