Skip to content

Commit 6d4e666

Browse files
committed
PERF: Restore old performances with .isin() on columns typed as np.uint64
1 parent a811388 commit 6d4e666

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/core/algorithms.py

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
is_object_dtype,
5757
is_signed_integer_dtype,
5858
needs_i8_conversion,
59+
is_dtype_equal,
5960
)
6061
from pandas.core.dtypes.concat import concat_compat
6162
from pandas.core.dtypes.dtypes import (
@@ -511,6 +512,7 @@ def isin(comps: ListLike, values: ListLike) -> npt.NDArray[np.bool_]:
511512
len(values) > 0
512513
and values.dtype.kind in "iufcb"
513514
and not is_signed_integer_dtype(comps)
515+
and not is_dtype_equal(values, comps)
514516
):
515517
# GH#46485 Use object to avoid upcast to float64 later
516518
# TODO: Share with _find_common_type_compat

0 commit comments

Comments
 (0)