Skip to content

Commit eca6bd3

Browse files
PERF: Restore old performances with .isin() on columns typed as np.ui… (#61320)
* PERF: Restore old performances with .isin() on columns typed as np.uint64 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 801bb24 commit eca6bd3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/core/algorithms.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
is_bool_dtype,
4848
is_complex_dtype,
4949
is_dict_like,
50+
is_dtype_equal,
5051
is_extension_array_dtype,
5152
is_float,
5253
is_float_dtype,
@@ -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)