MCPcopy Index your code
hub / github.com/numpy/numpy / _nanquantile_1d

Function _nanquantile_1d

numpy/lib/_nanfunctions_impl.py:1662–1684  ·  view source on GitHub ↗

Private function for rank 1 arrays. Compute quantile ignoring NaNs. See nanpercentile for parameter usage

(
    arr1d, q, overwrite_input=False, method="linear", weights=None,
    weak_q=False,
)

Source from the content-addressed store, hash-verified

1660
1661
1662def _nanquantile_1d(
1663 arr1d, q, overwrite_input=False, method="linear", weights=None,
1664 weak_q=False,
1665):
1666 """
1667 Private function for rank 1 arrays. Compute quantile ignoring NaNs.
1668 See nanpercentile for parameter usage
1669 """
1670 # TODO: What to do when arr1d = [1, np.nan] and weights = [0, 1]?
1671 arr1d, weights, overwrite_input = _remove_nan_1d(arr1d,
1672 second_arr1d=weights, overwrite_input=overwrite_input)
1673 if arr1d.size == 0:
1674 # convert to scalar
1675 return np.full(q.shape, np.nan, dtype=arr1d.dtype)[()]
1676
1677 return fnb._quantile_unchecked(
1678 arr1d,
1679 q,
1680 overwrite_input=overwrite_input,
1681 method=method,
1682 weights=weights,
1683 weak_q=weak_q,
1684 )
1685
1686
1687def _nanvar_dispatcher(a, axis=None, dtype=None, out=None, ddof=None,

Callers 1

Calls 1

_remove_nan_1dFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…