> df[newvar] = df[oldvar1] / df[oldvar2]
And instead of the pipe, we have chaining for which is super straightforward and readable:
> df[newvar] = (df[oldvar1] / df[oldvar2]).abs().rank().astype(str).str[:4]
and for more complex or non-chainable functions we have .pipe:
https://pandas.pydata.org/pandas-docs/stable/generated/panda...
which looks super similar to dplyr to me!
> df[newvar] = df[oldvar1] / df[oldvar2]
And instead of the pipe, we have chaining for which is super straightforward and readable:
> df[newvar] = (df[oldvar1] / df[oldvar2]).abs().rank().astype(str).str[:4]
and for more complex or non-chainable functions we have .pipe:
https://pandas.pydata.org/pandas-docs/stable/generated/panda...
which looks super similar to dplyr to me!