用法:
Series.pipe(func, *args, **kwargs)應用
func(self, *args, **kwargs)。- func:函數
應用於 Series/DataFrame/Index 的函數。
args和kwargs被傳遞到func。或者(callable, data_keyword)元組,其中data_keyword是一個字符串,指示需要 Series/DataFrame/Index 的callable的關鍵字。- args:可迭代的,可選的
傳遞給
func的位置參數。- kwargs:映射,可選
傳遞給
func的關鍵字參數字典。
- object:
func的返回類型。
- object:
參數:
返回:
例子:
將需要 Series、DataFrames 或 GroupBy 對象的函數鏈接在一起時,請使用
.pipe。而不是寫>>> func(g(h(df), arg1=a), arg2=b, arg3=c)你可以寫
>>> (df.pipe(h) ... .pipe(g, arg1=a) ... .pipe(func, arg2=b, arg3=c) ... )如果您有一個將數據作為(例如)第二個參數的函數,請傳遞一個元組,指示哪個關鍵字需要數據。例如,假設
f將其數據作為arg2:>>> (df.pipe(h) ... .pipe(g, arg1=a) ... .pipe((func, 'arg2'), arg1=a, arg3=c) ... )
相關用法
- Python cudf.Series.product用法及代碼示例
- Python cudf.Series.prod用法及代碼示例
- Python cudf.Series.pow用法及代碼示例
- 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用法及代碼示例
注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cudf.Series.pipe。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
