File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -699,21 +699,19 @@ cdef class BaseMultiIndexCodesEngine:
699
699
Keys are located by first locating each component against the respective
700
700
level, then locating (the integer representation of) codes.
701
701
"""
702
- def __init__ (self , object levels , object labels ,
703
- ndarray[uint64_t , ndim = 1 ] offsets):
702
+ def __init__ (self , object levels , object labels , ndarray offsets ):
704
703
"""
705
704
Parameters
706
705
----------
707
706
levels : list-like of numpy arrays
708
707
Levels of the MultiIndex.
709
708
labels : list-like of numpy arrays of integer dtype
710
709
Labels of the MultiIndex.
711
- offsets : numpy array of uint64 dtype
710
+ offsets : numpy array of int dtype
712
711
Pre-calculated offsets, one for each level of the index.
713
712
"""
714
713
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 )
714
+ self .offsets = offsets
717
715
718
716
# Transform labels in a single array, and add 2 so that we are working
719
717
# 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