cudf.Series.quantile#

Series.quantile(q=0.5, interpolation='linear', exact=True, quant_index=True)#

Return values at the given quantile.

Parameters
qfloat or array-like, default 0.5 (50% quantile)

0 <= q <= 1, the quantile(s) to compute

interpolation{‘linear’, ‘lower’, ‘higher’, ‘midpoint’, ‘nearest’}

This optional parameter specifies the interpolation method to use, when the desired quantile lies between two data points i and j:

columnslist of str

List of column names to include.

exactboolean

Whether to use approximate or exact quantile algorithm.

quant_indexboolean

Whether to use the list of quantiles as index.

Returns
float or Series

If q is an array, a Series will be returned where the index is q and the values are the quantiles, otherwise a float will be returned.

Examples

>>> import cudf
>>> series = cudf.Series([1, 2, 3, 4])
>>> series
0    1
1    2
2    3
3    4
dtype: int64
>>> series.quantile(0.5)
2.5
>>> series.quantile([0.25, 0.5, 0.75])
0.25    1.75
0.50    2.50
0.75    3.25
dtype: float64