Skip to content
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

Feature Request: pd.DataFrame drop method to include function support #17129

Closed
jolespin opened this issue Jul 31, 2017 · 5 comments
Closed

Feature Request: pd.DataFrame drop method to include function support #17129

jolespin opened this issue Jul 31, 2017 · 5 comments

Comments

@jolespin
Copy link

I think it would be useful if the pd.DataFrame's drop method could support a lambda or function that one can use as a filter such as below:
Also, on a side note I noticed that masking requires an extra step in the newest pandas in that it requires the mask to be converted to an array and then to a boolean. Not sure if that warrants an issue in itself but just wanted to mention that. It is also shown below:

image

@gfyoung
Copy link
Member

gfyoung commented Jul 31, 2017

Also, on a side note I noticed that masking requires an extra step in the newest pandas in that it requires the mask to be converted to an array and then to a boolean. Not sure if that warrants an issue in itself but just wanted to mention that.

@jolespin : Separate out into another issue, as it will be easier for us to organize.

@gfyoung
Copy link
Member

gfyoung commented Jul 31, 2017

Regarding your request for a lambda filter on drop, that seems reasonable given that we support this functionality for other functions like read_csv. Feel to implement and submit as a PR!

@jolespin
Copy link
Author

Working on it now! How can I test the code to see if it works? I need to add a few things.

https://github.com/jolespin/pandas/edit/master/pandas/core/generic.py

@gfyoung
Copy link
Member

gfyoung commented Jul 31, 2017

@jolespin : Install your branch and then run whatever code you used in this issue. The following section on our website here might be useful for instructions:

https://pandas.pydata.org/pandas-docs/stable/contributing.html

@mroeschke
Copy link
Member

Appears there hasn't been much activity or community support for this feature in a while so closing. Happy to reopen if there's renewed support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants