cudf.DataFrame.pipe#
- DataFrame.pipe(func, *args, **kwargs)[source]#
Apply
func(self, *args, **kwargs).- Parameters:
- funcfunction
Function to apply to the Series/DataFrame.
args, andkwargsare passed intofunc. Alternatively a(callable, data_keyword)tuple wheredata_keywordis a string indicating the keyword ofcallablethat expects the Series/DataFrame.- argsiterable, optional
Positional arguments passed into
func.- kwargsmapping, optional
A dictionary of keyword arguments passed into
func.
- Returns:
- objectthe return type of
func.
- objectthe return type of
Examples
Use
.pipewhen chaining together functions that expect Series, DataFrames or GroupBy objects.>>> import cudf >>> df = cudf.DataFrame({'a': [1, 2, 3]}) >>> def add_one(x): ... return x + 1 >>> df.pipe(add_one) a 0 2 1 3 2 4