-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: implement EA.delete #39405
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
ENH: implement EA.delete #39405
Conversation
jbrockmendel
commented
Jan 25, 2021
- closes #xxxx
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
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.
following comment
@@ -257,6 +257,17 @@ def searchsorted(self, value, side="left", sorter=None) -> np.ndarray: | |||
def _get_engine_target(self) -> np.ndarray: | |||
return np.asarray(self._data) | |||
|
|||
def delete(self, loc): | |||
""" |
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.
prob could add types back here
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.
mypy complained so i punted
Mmm @jbrockmendel what was the motivation for this change (can you just always provide that, for future readers?) In general I think we should carefully consider adding new methods, since that increases the burden on extension array maintainers to write efficient implementations. If we are adding methods to the public API then they should be documented. This would need a docstring and it should be included in the class docstring. |
An arbitrary EA-backed Index will need a |
I assume there are calls to |
There is an Index.delete method that would need to be implemented. So de-facto we have to implement a delete method or something equivalent to it. (np.delete wont work directly until we get |
meta-comment: this type of context is useful for evaluating PRs. Can you include motivation when creating a PR? My preference would be to rewrite |
Maybe there's a faster take/getitem-based imlpementation, but
|