Is your feature request related to a problem? Please describe.
Every once in a while I encounter a method that is not curried, which I would like to use in a expression.pipe, more often than not methods on pandas.DataFrame's. There currently is a way to curry the method inline:
res = expression.pipe(
df,
expression.curry_flip(1)(pd.DataFrame.merge)(df2)
)
However, all the parentheses become quite ugly and unreadable.
Describe the solution you'd like
We can of course make this a little better with a helper function that does the curry_flip of the first argument:
join = expression.curry_flip(1)
res = expression.pipe(
df,
join(pd.DataFrame.merge)(df2)
)
This is a little better, but the double pair of parentheses still feels off. Therefore, I propose to include a function to do this natively:
Describe alternatives you've considered
The name might be something to discuss, but conceptually join makes the most sense to me as you are joining segments in a pipeline. However, the generic name might make it a little confusing, so perhaps this should be made clear from the namespace.
Is your feature request related to a problem? Please describe. Every once in a while I encounter a method that is not curried, which I would like to use in a
expression.pipe
, more often than not methods onpandas.DataFrame
's. There currently is a way to curry the method inline:However, all the parentheses become quite ugly and unreadable.
Describe the solution you'd like We can of course make this a little better with a helper function that does the curry_flip of the first argument:
This is a little better, but the double pair of parentheses still feels off. Therefore, I propose to include a function to do this natively:
Describe alternatives you've considered The name might be something to discuss, but conceptually
join
makes the most sense to me as you are joining segments in a pipeline. However, the generic name might make it a little confusing, so perhaps this should be made clear from the namespace.