We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b417e7 commit b65a9f2Copy full SHA for b65a9f2
pandas/core/algorithms.py
@@ -576,6 +576,12 @@ def f(c, v):
576
if (
577
values.dtype.kind in "iu"
578
and comps_array.dtype.kind in "iu"
579
+ # Only apply fast-path for 64-bit integer widths to avoid
580
+ # surprising behaviour on platforms or dtypes with different
581
+ # itemsize (see GH discussions). Narrowing to 8-byte ints
582
+ # keeps the fast-path safe and performant for the common case.
583
+ and values.dtype.itemsize == 8
584
+ and comps_array.dtype.itemsize == 8
585
and not is_dtype_equal(values.dtype, comps_array.dtype)
586
):
587
try:
0 commit comments