Skip to content

API/BUG: get_indexer_non_unique(object_dtype)? #36320

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

Closed
jbrockmendel opened this issue Sep 13, 2020 · 2 comments
Closed

API/BUG: get_indexer_non_unique(object_dtype)? #36320

jbrockmendel opened this issue Sep 13, 2020 · 2 comments
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Sep 13, 2020

For get_indexer we do type inference on object dtype, but we dont do this for get_indexer_non_unique. Is this intentional?

dti = pd.date_range("2016-01-01", periods=3)
target = dti.astype(object)

>>> dti.get_indexer_non_unique(target)
(array([-1, -1, -1]), array([-1, -1, -1]))

>>> dti.get_indexer(target)
array([0, 1, 2])

We could also conceivably fall back to object-vs-object instead of returning no-matches.

There's also Cateegorical with matching categories dtype:

ci = pd.CategoricalIndex(dti)

>>> dti.get_indexer_non_unique(ci)
(array([-1, -1, -1]), array([-1, -1, -1]))

>>> dti.get_indexer(ci)
array([0, 1, 2])
@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 13, 2020
@jbrockmendel
Copy link
Member Author

@jreback can you weigh in on the desired behavior or (and possibly who else to ping)?

@jbrockmendel
Copy link
Member Author

Fixed in or near #38105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

1 participant