MCPcopy Create free account
hub / github.com/numpy/numpy / nanquantile

Function nanquantile

numpy/lib/nanfunctions.py:1394–1546  ·  view source on GitHub ↗

Compute the qth quantile of the data along the specified axis, while ignoring nan values. Returns the qth quantile(s) of the array elements. .. versionadded:: 1.15.0 Parameters ---------- a : array_like Input array or object that can be converted to an array, c

(
        a,
        q,
        axis=None,
        out=None,
        overwrite_input=False,
        method="linear",
        keepdims=np._NoValue,
        *,
        interpolation=None,
)

Source from the content-addressed store, hash-verified

1392
1393@array_function_dispatch(_nanquantile_dispatcher)
1394def nanquantile(
1395 a,
1396 q,
1397 axis=None,
1398 out=None,
1399 overwrite_input=False,
1400 method="linear",
1401 keepdims=np._NoValue,
1402 *,
1403 interpolation=None,
1404):
1405 """
1406 Compute the qth quantile of the data along the specified axis,
1407 while ignoring nan values.
1408 Returns the qth quantile(s) of the array elements.
1409
1410 .. versionadded:: 1.15.0
1411
1412 Parameters
1413 ----------
1414 a : array_like
1415 Input array or object that can be converted to an array, containing
1416 nan values to be ignored
1417 q : array_like of float
1418 Probability or sequence of probabilities for the quantiles to compute.
1419 Values must be between 0 and 1 inclusive.
1420 axis : {int, tuple of int, None}, optional
1421 Axis or axes along which the quantiles are computed. The
1422 default is to compute the quantile(s) along a flattened
1423 version of the array.
1424 out : ndarray, optional
1425 Alternative output array in which to place the result. It must
1426 have the same shape and buffer length as the expected output,
1427 but the type (of the output) will be cast if necessary.
1428 overwrite_input : bool, optional
1429 If True, then allow the input array `a` to be modified by intermediate
1430 calculations, to save memory. In this case, the contents of the input
1431 `a` after this function completes is undefined.
1432 method : str, optional
1433 This parameter specifies the method to use for estimating the
1434 quantile. There are many different methods, some unique to NumPy.
1435 See the notes for explanation. The options sorted by their R type
1436 as summarized in the H&F paper [1]_ are:
1437
1438 1. 'inverted_cdf'
1439 2. 'averaged_inverted_cdf'
1440 3. 'closest_observation'
1441 4. 'interpolated_inverted_cdf'
1442 5. 'hazen'
1443 6. 'weibull'
1444 7. 'linear' (default)
1445 8. 'median_unbiased'
1446 9. 'normal_unbiased'
1447
1448 The first three methods are discontinuous. NumPy further defines the
1449 following discontinuous variations of the default 'linear' (7.) option:
1450
1451 * 'lower'

Callers

nothing calls this directly

Calls 1

_nanquantile_uncheckedFunction · 0.85

Tested by

no test coverage detected