File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -712,8 +712,7 @@ cdef class BaseMultiIndexCodesEngine:
712
712
Pre-calculated offsets, one for each level of the index.
713
713
"""
714
714
self .levels = levels
715
- # Downcast the type if possible, to prevent upcasting when shifting codes:
716
- self .offsets = offsets.astype(np.min_scalar_type(offsets[0 ]), copy = False )
715
+ self .offsets = offsets
717
716
718
717
# Transform labels in a single array, and add 2 so that we are working
719
718
# with positive integers (-1 for NaN becomes 1). This enables us to
Original file line number Diff line number Diff line change @@ -1201,7 +1201,9 @@ def _engine(self):
1201
1201
# equivalent to sorting lexicographically the codes themselves. Notice
1202
1202
# that each level needs to be shifted by the number of bits needed to
1203
1203
# represent the _previous_ ones:
1204
- offsets = np .concatenate ([lev_bits [1 :], [0 ]]).astype ("uint64" )
1204
+ offsets = np .concatenate ([lev_bits [1 :], [0 ]])
1205
+ # Downcast the type if possible, to prevent upcasting when shifting codes:
1206
+ offsets = offsets .astype (np .min_scalar_type (int (offsets [0 ])))
1205
1207
1206
1208
# Check the total number of bits needed for our representation:
1207
1209
if lev_bits [0 ] > 64 :
You can’t perform that action at this time.
0 commit comments