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

Function _get_gamma

numpy/lib/function_base.py:4619–4638  ·  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

4617
4618
4619def _get_gamma(virtual_indexes, previous_indexes, method):
4620 """
4621 Compute gamma (a.k.a 'm' or 'weight') for the linear interpolation
4622 of quantiles.
4623
4624 virtual_indexes : array_like
4625 The indexes where the percentile is supposed to be found in the sorted
4626 sample.
4627 previous_indexes : array_like
4628 The floor values of virtual_indexes.
4629 interpolation : dict
4630 The interpolation method chosen, which may have a specific rule
4631 modifying gamma.
4632
4633 gamma is usually the fractional part of virtual_indexes but can be modified
4634 by the interpolation method.
4635 """
4636 gamma = np.asanyarray(virtual_indexes - previous_indexes)
4637 gamma = method["fix_gamma"](gamma, virtual_indexes)
4638 return np.asanyarray(gamma)
4639
4640
4641def _lerp(a, b, t, out=None):

Callers 1

_quantileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected