Skip to content

Commit aae1c1c

Browse files
Moving ensure and take
1 parent d1d6513 commit aae1c1c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

doc/source/whatsnew/v0.19.1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ Performance Improvements
3030

3131
Bug Fixes
3232
~~~~~~~~~
33+
- Bug in ``Series.sort_index`` where parameters ``kind`` and ``na_position`` did not exist (:issue:`13589`, :issue:`14444`)
3334

3435

3536

36-
- Bug in ``Series.sort_index`` where parameters ``kind`` and ``na_position`` did not exist (:issue:`13589`, :issue:`14444`)
3737

3838
- Bug in localizing an ambiguous timezone when a boolean is passed (:issue:`14402`)
3939

pandas/core/series.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1783,14 +1783,14 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
17831783
elif isinstance(index, MultiIndex):
17841784
from pandas.core.groupby import _lexsort_indexer
17851785
indexer = _lexsort_indexer(index.labels, orders=ascending)
1786-
indexer = _ensure_platform_int(indexer)
1787-
new_index = index.take(indexer)
1786+
17881787
else:
17891788
from pandas.core.groupby import _nargsort
1790-
17911789
indexer = _nargsort(index, kind=kind, ascending=ascending,
17921790
na_position=na_position)
1793-
new_index = index.take(indexer)
1791+
1792+
indexer = _ensure_platform_int(indexer)
1793+
new_index = index.take(indexer)
17941794

17951795
new_values = self._values.take(indexer)
17961796
result = self._constructor(new_values, index=new_index)

0 commit comments

Comments
 (0)