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