Skip to content

Commit 21569bb

Browse files
committed
add timestamp check
1 parent 3b66275 commit 21569bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/core/algorithms.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from pandas.core import common as com
3333
from pandas._libs import algos, lib, hashtable as htable
3434
from pandas._libs.tslib import iNaT
35+
from pandas._libs.tslibs.timestamps import Timestamp
3536

3637

3738
# --------------- #
@@ -414,7 +415,8 @@ def isin(comps, values):
414415
all(is_float(i) for i in values)))
415416
check_datetime = (is_datetime_or_timedelta_dtype(dtype) and
416417
(is_datetime_or_timedelta_dtype(values) or
417-
all(is_datetimelike(i) for i in values)))
418+
all(is_datetimelike(i) for i in values) or
419+
all(isinstance(i, Timestamp) for i in values)))
418420
if check_int or check_float or check_datetime:
419421
values, _, _ = _ensure_data(values, dtype=dtype)
420422
else:

0 commit comments

Comments
 (0)