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

Function _get_gamma

numpy/lib/_function_base_impl.py:4570–4591  ·  view source on GitHub ↗

Compute gamma (a.k.a 'm' or 'weight') for the linear interpolation of quantiles. virtual_indexes : array_like The indexes where the percentile is supposed to be found in the sorted sample. previous_indexes : array_like The floor values of virtual_indexes.

(virtual_indexes, previous_indexes, method)

Source from the content-addressed store, hash-verified

4568
4569
4570def _get_gamma(virtual_indexes, previous_indexes, method):
4571 """
4572 Compute gamma (a.k.a 'm' or 'weight') for the linear interpolation
4573 of quantiles.
4574
4575 virtual_indexes : array_like
4576 The indexes where the percentile is supposed to be found in the sorted
4577 sample.
4578 previous_indexes : array_like
4579 The floor values of virtual_indexes.
4580 method : dict
4581 The interpolation method chosen, which may have a specific rule
4582 modifying gamma.
4583
4584 gamma is usually the fractional part of virtual_indexes but can be modified
4585 by the interpolation method.
4586 """
4587 gamma = np.asanyarray(virtual_indexes - previous_indexes)
4588 gamma = method["fix_gamma"](gamma, virtual_indexes)
4589 # Ensure both that we have an array, and that we keep the dtype
4590 # (which may have been matched to the input array).
4591 return np.asanyarray(gamma, dtype=virtual_indexes.dtype)
4592
4593
4594def _lerp(a, b, t, out=None):

Callers 1

_quantileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…