@@ -3141,7 +3141,7 @@ def duplicated(self, subset=None, keep='first'):
3141
3141
-------
3142
3142
duplicated : Series
3143
3143
"""
3144
- from pandas .core .groupby import get_group_index
3144
+ from pandas .core .sorting import get_group_index
3145
3145
from pandas .hashtable import duplicated_int64 , _SIZE_HINT_LIMIT
3146
3146
3147
3147
def f (vals ):
@@ -3179,7 +3179,7 @@ def sort_values(self, by, axis=0, ascending=True, inplace=False,
3179
3179
raise ValueError ('Length of ascending (%d) != length of by (%d)' %
3180
3180
(len (ascending ), len (by )))
3181
3181
if len (by ) > 1 :
3182
- from pandas .core .groupby import _lexsort_indexer
3182
+ from pandas .core .sorting import lexsort_indexer
3183
3183
3184
3184
def trans (v ):
3185
3185
if needs_i8_conversion (v ):
@@ -3193,11 +3193,11 @@ def trans(v):
3193
3193
raise ValueError ('Cannot sort by duplicate column %s' %
3194
3194
str (x ))
3195
3195
keys .append (trans (k ))
3196
- indexer = _lexsort_indexer (keys , orders = ascending ,
3197
- na_position = na_position )
3196
+ indexer = lexsort_indexer (keys , orders = ascending ,
3197
+ na_position = na_position )
3198
3198
indexer = _ensure_platform_int (indexer )
3199
3199
else :
3200
- from pandas .core .groupby import _nargsort
3200
+ from pandas .core .sorting import nargsort
3201
3201
3202
3202
by = by [0 ]
3203
3203
k = self .xs (by , axis = other_axis ).values
@@ -3214,8 +3214,8 @@ def trans(v):
3214
3214
if isinstance (ascending , (tuple , list )):
3215
3215
ascending = ascending [0 ]
3216
3216
3217
- indexer = _nargsort (k , kind = kind , ascending = ascending ,
3218
- na_position = na_position )
3217
+ indexer = nargsort (k , kind = kind , ascending = ascending ,
3218
+ na_position = na_position )
3219
3219
3220
3220
new_data = self ._data .take (indexer ,
3221
3221
axis = self ._get_block_manager_axis (axis ),
@@ -3300,17 +3300,17 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
3300
3300
sort_remaining = sort_remaining )
3301
3301
3302
3302
elif isinstance (labels , MultiIndex ):
3303
- from pandas .core .groupby import _lexsort_indexer
3303
+ from pandas .core .sorting import lexsort_indexer
3304
3304
3305
3305
# make sure that the axis is lexsorted to start
3306
3306
# if not we need to reconstruct to get the correct indexer
3307
3307
if not labels .is_lexsorted ():
3308
3308
labels = MultiIndex .from_tuples (labels .values )
3309
3309
3310
- indexer = _lexsort_indexer (labels .labels , orders = ascending ,
3311
- na_position = na_position )
3310
+ indexer = lexsort_indexer (labels .labels , orders = ascending ,
3311
+ na_position = na_position )
3312
3312
else :
3313
- from pandas .core .groupby import _nargsort
3313
+ from pandas .core .sorting import nargsort
3314
3314
3315
3315
# GH11080 - Check monotonic-ness before sort an index
3316
3316
# if monotonic (already sorted), return None or copy() according
@@ -3322,8 +3322,8 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
3322
3322
else :
3323
3323
return self .copy ()
3324
3324
3325
- indexer = _nargsort (labels , kind = kind , ascending = ascending ,
3326
- na_position = na_position )
3325
+ indexer = nargsort (labels , kind = kind , ascending = ascending ,
3326
+ na_position = na_position )
3327
3327
3328
3328
new_data = self ._data .take (indexer ,
3329
3329
axis = self ._get_block_manager_axis (axis ),
0 commit comments