Skip to content

Commit c94a117

Browse files
committed
base tests pass
1 parent 0ea7348 commit c94a117

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/core/algorithms.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,17 @@ def isin(comps, values):
404404
if not isinstance(values, (ABCIndex, ABCSeries, np.ndarray)):
405405
values = construct_1d_object_array_from_listlike(list(values))
406406

407-
from pandas.core.dtypes.common import is_datetimelike
407+
from pandas.core.dtypes.common import is_datetimelike, is_float
408408
comps, dtype, _ = _ensure_data(comps)
409-
# Convert `values` to `dtype` if `values` is datetime-like and `dtype` is datetime-like
409+
# Convert `values` to `dtype` if `values` is datetime/float-like and `dtype` is datetime/float-like
410410
if (is_datetime_or_timedelta_dtype(dtype) and
411411
(is_datetime_or_timedelta_dtype(values) or
412412
all(is_datetimelike(i) for i in values))):
413413
values, _, _ = _ensure_data(values, dtype=dtype)
414+
elif (is_float_dtype(dtype) and
415+
(is_float_dtype(values) or
416+
all(is_float(i) for i in values))):
417+
values, _, _ = _ensure_data(values, dtype=dtype)
414418
else:
415419
values, _, _ = _ensure_data(values)
416420

0 commit comments

Comments
 (0)