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

Function _quantile_ureduce_func

numpy/lib/_function_base_impl.py:4651–4688  ·  view source on GitHub ↗
(
    a: np.ndarray,
    q: np.ndarray,
    weights: np.ndarray | None,
    axis: int | None = None,
    out: np.ndarray | None = None,
    overwrite_input: bool = False,
    method: str = "linear",
    weak_q: bool = False,
)

Source from the content-addressed store, hash-verified

4649
4650
4651def _quantile_ureduce_func(
4652 a: np.ndarray,
4653 q: np.ndarray,
4654 weights: np.ndarray | None,
4655 axis: int | None = None,
4656 out: np.ndarray | None = None,
4657 overwrite_input: bool = False,
4658 method: str = "linear",
4659 weak_q: bool = False,
4660) -> np.ndarray:
4661 if q.ndim > 2:
4662 # The code below works fine for nd, but it might not have useful
4663 # semantics. For now, keep the supported dimensions the same as it was
4664 # before.
4665 raise ValueError("q must be a scalar or 1d")
4666 if overwrite_input:
4667 if axis is None:
4668 axis = 0
4669 arr = a.ravel()
4670 wgt = None if weights is None else weights.ravel()
4671 else:
4672 arr = a
4673 wgt = weights
4674 elif axis is None:
4675 axis = 0
4676 arr = a.flatten()
4677 wgt = None if weights is None else weights.flatten()
4678 else:
4679 arr = a.copy()
4680 wgt = weights
4681 result = _quantile(arr,
4682 quantiles=q,
4683 axis=axis,
4684 method=method,
4685 out=out,
4686 weights=wgt,
4687 weak_q=weak_q)
4688 return result
4689
4690
4691def _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

Used in the wild real call sites across dependent graphs

searching dependent graphs…