BUG: isin - dtype conversions (Timestamp vs ints) (original) (raw)


related: #34125 : could be closed in favor of that if it is too much of a duplicate.

Code Sample, a copy-pastable example

import pandas as pd s = pd.Series(pd.date_range("jan-01-2013", "jan-05-2013")) s.isin([1356998400000000000])

0 True 1 False 2 False 3 False 4 False dtype: bool

Problem description

Problem arises here because algos._ensure_dtype(s) returns an np.int64 array (that matches the data) and dtype=<M8[ns].

Expected Output

0 False 1 False 2 False 3 False 4 False dtype: bool