From 43baf9ecfe6d9d024c08d0cf7547db5dba7668b3 Mon Sep 17 00:00:00 2001 From: jreback Date: Thu, 27 Mar 2014 18:47:53 -0400 Subject: [PATCH] COMPAT: change Series.sort to use na_position rather than deprecated na_last --- pandas/core/series.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 14b4e084cdeae..c3300e7b35a8b 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -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) @@ -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: