-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add keep: :none
argument to mutate functions
#966
Add keep: :none
argument to mutate functions
#966
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this. IIUC it's 100% opt-in (doesn't change the current API) and provides a nice bit of sugar to avoid an additional select after mutate.
Co-authored-by: Christopher Grainger <[email protected]>
💚 💙 💜 💛 ❤️ |
@cigrainger @josevalim – this repo was a joy to work in. The contributor docs were great and the mix tasks worked flawlessly (and tests are super fast). I wouldn't have been able to push this over the line if any of that wasn't true. Thanks for the awesome project. |
This PR adds a new
keep
option to themutate
andmutate_with
functions in the DataFrame module. This option allows users to control which columns are retained in the output DataFrame after a mutation operation. Closes #965Examples of usage
Regular DataFrame:
Grouped DataFrame:
Considerations
:all
or:none
) instead of a boolean for maximum forwards compatibility.