Skip to content

Commit c43a029

Browse files
committed
using if/else construct to pick sorting function for categoricals
1 parent f8ec019 commit c43a029

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

pandas/core/categorical.py

-19
Original file line numberDiff line numberDiff line change
@@ -1404,25 +1404,6 @@ def sort_values(self, inplace=False, ascending=True, na_position='last'):
14041404
return self._constructor(values=codes, categories=self.categories,
14051405
ordered=self.ordered, fastpath=True)
14061406

1407-
def _funcs_for_rank(self):
1408-
"""
1409-
For correctly ranking ordered categorical data. See GH#15420
1410-
1411-
Ordered categorical data should be ranked on the basis of
1412-
codes with -1 translated to NaN, as floats, and unordered
1413-
as objects
1414-
1415-
Returns
1416-
-------
1417-
numpy array
1418-
1419-
"""
1420-
if self._ordered:
1421-
f = _algos.rank_1d_float64
1422-
else:
1423-
f = _algos.rank_1d_object
1424-
return f
1425-
14261407
def _values_for_rank(self):
14271408
"""
14281409
For correctly ranking ordered categorical data. See GH#15420

0 commit comments

Comments
 (0)