In a pipe i want to use the result of previous steps as the second argument to a subsequent step.
In R i can use the result of the previous chain using . like so:
df %>% b(arg1b) %>% c(arg1c, .)
How to do this in python for example using pipe?
df.pipe(b, arg1b).pipe(c, arg1c, **)
syntax error
>Solution :
I’m not an active user of pandas, but this documentation page on pandas.DataFrame.pipe seems to cover your case
df.pipe(b, arg1b)
.pipe((c, 'second_arg_name'), arg1c)
where 'second_arg_name' should be replaced with actual name of the second argument in function c