Skip to content

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

Merged
merged 1 commit into from
Dec 20, 2014

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Dec 20, 2014

For 2nd issue of #8875.

  • Change Index.duplicated to return np.array.

@shoyer shoyer added this to the 0.16.0 milestone Dec 20, 2014
@@ -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)
Copy link
Member

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?

Copy link
Member Author

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`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather

Copy link
Member Author

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!

@jreback jreback merged commit 83fd0b4 into pandas-dev:master Dec 20, 2014
@jreback
Copy link
Contributor

jreback commented Dec 20, 2014

@sinhrks thanks! (I made the minor correction).

@sinhrks sinhrks deleted the duplicated2 branch February 15, 2015 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants