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

Function _quantile_ureduce_func

numpy/lib/function_base.py:4697–4727  ·  view source on GitHub ↗
(
        a: np.array,
        q: np.array,
        axis: int = None,
        out=None,
        overwrite_input: bool = False,
        method="linear",
)

Source from the content-addressed store, hash-verified

4695
4696
4697def _quantile_ureduce_func(
4698 a: np.array,
4699 q: np.array,
4700 axis: int = None,
4701 out=None,
4702 overwrite_input: bool = False,
4703 method="linear",
4704) -> np.array:
4705 if q.ndim > 2:
4706 # The code below works fine for nd, but it might not have useful
4707 # semantics. For now, keep the supported dimensions the same as it was
4708 # before.
4709 raise ValueError("q must be a scalar or 1d")
4710 if overwrite_input:
4711 if axis is None:
4712 axis = 0
4713 arr = a.ravel()
4714 else:
4715 arr = a
4716 else:
4717 if axis is None:
4718 axis = 0
4719 arr = a.flatten()
4720 else:
4721 arr = a.copy()
4722 result = _quantile(arr,
4723 quantiles=q,
4724 axis=axis,
4725 method=method,
4726 out=out)
4727 return result
4728
4729
4730def _get_indexes(arr, virtual_indexes, valid_values_count):

Callers

nothing calls this directly

Calls 4

_quantileFunction · 0.85
flattenMethod · 0.80
ravelMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected