-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
API: Index.duplicated should return np.array #9112
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
Conversation
@@ -486,14 +487,15 @@ def searchsorted(self, key, side='left'): | |||
@Appender(_shared_docs['drop_duplicates'] % _indexops_doc_kwargs) | |||
def drop_duplicates(self, take_last=False, inplace=False): | |||
duplicated = self.duplicated(take_last=take_last) | |||
result = self[~(duplicated.values).astype(bool)] | |||
values = getattr(duplicated, 'values', duplicated) |
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.
do you still need this -- can duplicated be an index 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.
This was intended for Series
, but looks not required. Both modified.
@@ -27,6 +27,8 @@ Backwards incompatible API changes | |||
|
|||
.. _whatsnew_0160.api_breaking: | |||
|
|||
- ``Index.duplicated`` now returns `np.array(dtype=bool)` rathar than `Index(dtype=object)` containing `bool` values. (:issue:`8875`) |
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.
rather
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.
Ah, thanks for correction and merge!
@sinhrks thanks! (I made the minor correction). |
For 2nd issue of #8875.
Index.duplicated
to returnnp.array
.