w3resource

Pandas DataFrame: pipe() function

DataFrame - pipe() function

The pipe() function is used to apply func(self, *args, **kwargs).

Syntax:

DataFrame.pipe(self, func, *args, **kwargs)

Parameters:

Name Description Type/Default Value Required / Optional
func                      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. function Required
args    positional arguments passed into func. iterable Optional
kwargs      a dictionary of keyword arguments passed into func.  mapping Optional

Returns: object - the return type of func.

Notes:

Use .pipe when chaining together functions that expect Series, DataFrames or GroupBy objects. Instead of writing

Example:


Download the Pandas DataFrame Notebooks from here.

Previous: DataFrame - applymap() function
Next: DataFrame - agg() function



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/pandas/dataframe/dataframe-pipe.php