Skip to content

Commit

Permalink
COMPAT: change Series.sort to use na_position rather than deprecated …
Browse files Browse the repository at this point in the history
…na_last
  • Loading branch information
jreback committed Mar 27, 2014
1 parent 87e1212 commit 43baf9e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1642,8 +1642,9 @@ def sort(self, axis=0, kind='quicksort', order=None, ascending=True):
raise ValueError("This Series is a view of some other array, to "
"sort in-place you must create a copy")

result = self.order(na_last=True, kind=kind,
ascending=ascending)
result = self.order(kind=kind,
ascending=ascending,
na_position='last')

self._update_inplace(result)

Expand Down Expand Up @@ -1768,7 +1769,7 @@ def order(self, na_last=None, ascending=True, kind='mergesort', na_position='las
warnings.warn(("na_last is deprecated. Please use na_position instead"),
FutureWarning)
na_position = 'last' if na_last else 'first'

def _try_kind_sort(arr):
# easier to ask forgiveness than permission
try:
Expand Down

0 comments on commit 43baf9e

Please sign in to comment.