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 246ffec commit af06a77Copy full SHA for af06a77
pandas/core/reshape/reshape.py
@@ -234,13 +234,11 @@ def _make_selectors(self) -> None:
234
self.group_index = comp_index
235
self.mask = mask
236
if self.sort:
237
- import sys
+ from pandas.compat import PY314
238
+ from pandas.compat.numpy import np_version_gt2
239
240
# GH 63314: avoid searchsorted bug with py3.14 + numpy < 2.0
- numpy_major = int(np.__version__.split(".")[0])
241
- has_searchsorted_bug = sys.version_info >= (3, 14) and numpy_major < 2
242
-
243
- if has_searchsorted_bug:
+ if PY314 and not np_version_gt2:
244
# use manual approach instead of buggy searchsorted
245
self.compressor = np.sort(np.unique(comp_index, return_index=True)[1])
246
else:
0 commit comments