atoti.array.quantile_index()#
- atoti.array.quantile_index(measure, /, q, *, mode='inc', interpolation='lower')#
Return a measure equal to the index of requested quantile of the elements of the passed array measure.
- Parameters:
measure (VariableMeasureConvertible) – The measure to get the quantile of.
q (float | VariableMeasureConvertible) – The quantile to take. For instance,
0.95
is the 95th percentile and0.5
is the median.mode (Literal['simple', 'centered', 'inc', 'exc']) –
The method used to calculate the index of the quantile. Available options are, when searching for the q quantile of a vector
X
:simple
:len(X) * q
centered
:len(X) * q + 0.5
exc
:(len(X) + 1) * q
inc
:(len(X) - 1) * q + 1
interpolation (Literal['higher', 'lower', 'nearest']) –
If the quantile index is not an integer, the interpolation decides what value is returned. The different options are, considering a quantile index
k
withi < k < j
for the original vectorX
and the sorted vectorY
:lowest
: the index inX
ofY[i]
highest
: the index inX
ofY[j]
nearest
: the index inX
ofY[i]
orY[j]
depending on which ofi
orj
is closest tok
- Return type:
MeasureDescription