Skip to content

API/BUG: get_indexer_non_unique(object_dtype)? #36320

Closed
@jbrockmendel

Description

@jbrockmendel

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])

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions