Skip to content

Commit c8b7d2f

Browse files
committed
BLD: fix platform int issues
1 parent da8bc6c commit c8b7d2f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pandas/core/groupby.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,11 +2012,12 @@ def _get_indices_dict(label_list, keys):
20122012
sorter, _ = lib.groupsort_indexer(com._ensure_int64(group_index),
20132013
np.prod(shape))
20142014

2015-
sorted_labels = [lab.take(sorter) for lab in label_list]
2016-
group_index = group_index.take(sorter)
2017-
index = np.arange(len(group_index)).take(sorter)
2015+
sorter_int = com._ensure_platform_int(sorter)
20182016

2019-
return lib.indices_fast(index, group_index, keys, sorted_labels)
2017+
sorted_labels = [lab.take(sorter_int) for lab in label_list]
2018+
group_index = group_index.take(sorter_int)
2019+
2020+
return lib.indices_fast(sorter, group_index, keys, sorted_labels)
20202021

20212022
#----------------------------------------------------------------------
20222023
# sorting levels...cleverly?

0 commit comments

Comments
 (0)