Pandas: Feature Request: Include SSPipe Functionality

Created on 15 Jul 2019  Â·  12Comments  Â·  Source: pandas-dev/pandas

Could pandas include as a submodule "SSPipe" Package?

https://pypi.org/project/sspipe/
https://sspipe.github.io/

DataFrame object already has a .pipe() method, but the objective is to make the "pipe" (Equivalent to R's magrittr %>% functional pipe) a standard that can be extrapolated to all Python objects and casuistics.

API Design Needs Discussion

All 12 comments

So you are basically asking to replicate the behavior of the pipe method with the | operator?

Plus a "px" object, which stands as a pipeable object.

In R's magrittr, after using a pipe %>%, objects can be accessed from any argument using a dot (.):

https://cran.r-project.org/web/packages/magrittr/vignettes/magrittr.html

You could simply import SSPipe as a submodule as a start :)

And take care of it's maintenance. Fast and easy.

Even if we did want this, we wouldn't be able to since we already use __or__ for elementwise or.

Just rename it, I would call such operator %>%, just as R's magrittr pipe.

More familiar for Data Scientist with a R Background.

You can't define custom operators in Python.

Couldn't __or__ function be called %>% or another name?

There must be a solution.

I don't understand what you're proposing.

Add SSPipe as a Pandas submodule:

https://pypi.org/project/sspipe/
https://sspipe.github.io/

And make it work by fixing the issue with __or__ in the submodule internals:

https://github.com/JulienPalard/Pipe/blob/master/pipe.py

https://github.com/sspipe/sspipe/blob/master/sspipe/pipe.py

Thanks but I don't think taking over maintenance of another package is something we want to do so closing for now.

I don't think we'd make that kind of change.

On Wed, Jul 17, 2019 at 11:20 AM Juan Telleria notifications@github.com
wrote:

Add SSPipe as a Pandas submodule:

https://pypi.org/project/sspipe/
https://sspipe.github.io/

And make it work by fixing the issue with __or__ in the submodule
internals:

https://github.com/JulienPalard/Pipe/blob/master/pipe.py

https://github.com/sspipe/sspipe/blob/master/sspipe/pipe.py

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/pandas-dev/pandas/issues/27400?email_source=notifications&email_token=AAKAOIWBGM2CJPPZXEWYQWLP75BGVA5CNFSM4IDYPASKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2E6B2Q#issuecomment-512352490,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKAOIRBVWBOTTWVNGPTFQDP75BGVANCNFSM4IDYPASA
.

@wesm What do you think about the pipe %>% Topic within Pandas?

Was this page helpful?
0 / 5 - 0 ratings