Skip to content

Commit 43baf9e

Browse files
committed
COMPAT: change Series.sort to use na_position rather than deprecated na_last
1 parent 87e1212 commit 43baf9e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pandas/core/series.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1642,8 +1642,9 @@ def sort(self, axis=0, kind='quicksort', order=None, ascending=True):
16421642
raise ValueError("This Series is a view of some other array, to "
16431643
"sort in-place you must create a copy")
16441644

1645-
result = self.order(na_last=True, kind=kind,
1646-
ascending=ascending)
1645+
result = self.order(kind=kind,
1646+
ascending=ascending,
1647+
na_position='last')
16471648

16481649
self._update_inplace(result)
16491650

@@ -1768,7 +1769,7 @@ def order(self, na_last=None, ascending=True, kind='mergesort', na_position='las
17681769
warnings.warn(("na_last is deprecated. Please use na_position instead"),
17691770
FutureWarning)
17701771
na_position = 'last' if na_last else 'first'
1771-
1772+
17721773
def _try_kind_sort(arr):
17731774
# easier to ask forgiveness than permission
17741775
try:

0 commit comments

Comments
 (0)