hipdf.Series.pipe

Contents

hipdf.Series.pipe#

1 min read time

Applies to Linux

Series.pipe(func, *args, **kwargs)#

Apply func(self, *args, **kwargs).

Parameters#

funcfunction

Function to apply to the Series/DataFrame. args, and kwargs are passed into func. Alternatively a (callable, data_keyword) tuple where data_keyword is a string indicating the keyword of callable that expects the Series/DataFrame.

argsiterable, optional

Positional arguments passed into func.

kwargsmapping, optional

A dictionary of keyword arguments passed into func.

Returns#

object : the return type of func.

Examples#

Use .pipe when 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