用法:
Series.quantile(q=0.5, interpolation='linear', exact=True, quant_index=True)
返回給定分位數的值。
- q:float 或 array-like,默認 0.5(50% 分位數)
0 <= q <= 1,要計算的分位數
- interpolation:{'線性',‘lower’, ‘higher’, ‘midpoint’, ‘nearest’}
當所需的分位數位於兩個數據點 i 和 j 之間時,此可選參數指定要使用的插值方法:
- columns:str 列表
要包含的列名列表。
- exact:布爾值
是否使用近似或精確分位數算法。
- quant_index:布爾值
是否使用分位數列表作為索引。
- 浮點數或係列
如果
q
是一個數組,則將返回一個係列,其中索引為q
,值是分位數,否則將返回一個浮點數。
參數:
返回:
例子:
>>> 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
相關用法
- Python cudf.Series.ceil用法及代碼示例
- Python cudf.Series.update用法及代碼示例
- Python cudf.Series.max用法及代碼示例
- Python cudf.Series.head用法及代碼示例
- Python cudf.Series.reindex用法及代碼示例
- Python cudf.Series.interleave_columns用法及代碼示例
- Python cudf.Series.min用法及代碼示例
- Python cudf.Series.nlargest用法及代碼示例
- Python cudf.Series.to_frame用法及代碼示例
- Python cudf.Series.mask用法及代碼示例
- Python cudf.Series.notnull用法及代碼示例
- Python cudf.Series.isnull用法及代碼示例
- Python cudf.Series.rmod用法及代碼示例
- Python cudf.Series.map用法及代碼示例
- Python cudf.Series.nsmallest用法及代碼示例
- Python cudf.Series.data用法及代碼示例
- Python cudf.Series.lt用法及代碼示例
- Python cudf.Series.product用法及代碼示例
- Python cudf.Series.add用法及代碼示例
- Python cudf.Series.apply用法及代碼示例
注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cudf.Series.quantile。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。