Skip to content

Commit 18ea902

Browse files
committed
CLN: create core/sorting.py
1 parent 92dcb07 commit 18ea902

File tree

12 files changed

+704
-715
lines changed

12 files changed

+704
-715
lines changed

pandas/core/frame.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -3141,7 +3141,7 @@ def duplicated(self, subset=None, keep='first'):
31413141
-------
31423142
duplicated : Series
31433143
"""
3144-
from pandas.core.groupby import get_group_index
3144+
from pandas.core.sorting import get_group_index
31453145
from pandas.hashtable import duplicated_int64, _SIZE_HINT_LIMIT
31463146

31473147
def f(vals):
@@ -3179,7 +3179,7 @@ def sort_values(self, by, axis=0, ascending=True, inplace=False,
31793179
raise ValueError('Length of ascending (%d) != length of by (%d)' %
31803180
(len(ascending), len(by)))
31813181
if len(by) > 1:
3182-
from pandas.core.groupby import _lexsort_indexer
3182+
from pandas.core.sorting import _lexsort_indexer
31833183

31843184
def trans(v):
31853185
if needs_i8_conversion(v):
@@ -3197,7 +3197,7 @@ def trans(v):
31973197
na_position=na_position)
31983198
indexer = _ensure_platform_int(indexer)
31993199
else:
3200-
from pandas.core.groupby import _nargsort
3200+
from pandas.core.sorting import _nargsort
32013201

32023202
by = by[0]
32033203
k = self.xs(by, axis=other_axis).values
@@ -3300,7 +3300,7 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
33003300
sort_remaining=sort_remaining)
33013301

33023302
elif isinstance(labels, MultiIndex):
3303-
from pandas.core.groupby import _lexsort_indexer
3303+
from pandas.core.sorting import _lexsort_indexer
33043304

33053305
# make sure that the axis is lexsorted to start
33063306
# if not we need to reconstruct to get the correct indexer
@@ -3310,7 +3310,7 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
33103310
indexer = _lexsort_indexer(labels.labels, orders=ascending,
33113311
na_position=na_position)
33123312
else:
3313-
from pandas.core.groupby import _nargsort
3313+
from pandas.core.sorting import _nargsort
33143314

33153315
# GH11080 - Check monotonic-ness before sort an index
33163316
# if monotonic (already sorted), return None or copy() according

0 commit comments

Comments
 (0)