From a29554ccd0affa6164c45e3eeed622367d09a517 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 13 Aug 2018 14:23:42 +0200 Subject: [PATCH 1/2] DOC/DEPR: clarify argmin/argmax deprecation message --- pandas/core/series.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index b84179875db1f..42be984651696 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -1807,16 +1807,20 @@ def idxmax(self, axis=0, skipna=True, *args, **kwargs): argmin = deprecate( 'argmin', idxmin, '0.21.0', msg=dedent("""\ - 'argmin' is deprecated, use 'idxmin' instead. The behavior of 'argmin' - will be corrected to return the positional minimum in the future. - Use 'series.values.argmin' to get the position of the minimum row.""") + the behaviour of 'Series.argmin' is deprecated, use 'idxmin' instead. + The behavior of 'argmin' will be corrected to return the positional + minimum in the future. For now, use 'series.values.argmin' or + 'np.argmin(np.array(values))' to get the position of the minimum + row.""") ) argmax = deprecate( 'argmax', idxmax, '0.21.0', msg=dedent("""\ - 'argmax' is deprecated, use 'idxmax' instead. The behavior of 'argmax' - will be corrected to return the positional maximum in the future. - Use 'series.values.argmax' to get the position of the maximum row.""") + the behaviour of 'Series.argmax' is deprecated, use 'idxmax' instead. + The behavior of 'argmax' will be corrected to return the positional + maximum in the future. For now, use 'series.values.argmax' or + 'np.argmax(np.array(values))' to get the position of the maximum + row.""") ) def round(self, decimals=0, *args, **kwargs): From ef31468efac0560519811637bed88ecc371ccf47 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 13 Aug 2018 14:41:41 +0200 Subject: [PATCH 2/2] edits --- pandas/core/series.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 42be984651696..d80a9a0fc52f4 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -1807,7 +1807,8 @@ def idxmax(self, axis=0, skipna=True, *args, **kwargs): argmin = deprecate( 'argmin', idxmin, '0.21.0', msg=dedent("""\ - the behaviour of 'Series.argmin' is deprecated, use 'idxmin' instead. + The current behaviour of 'Series.argmin' is deprecated, use 'idxmin' + instead. The behavior of 'argmin' will be corrected to return the positional minimum in the future. For now, use 'series.values.argmin' or 'np.argmin(np.array(values))' to get the position of the minimum @@ -1816,7 +1817,8 @@ def idxmax(self, axis=0, skipna=True, *args, **kwargs): argmax = deprecate( 'argmax', idxmax, '0.21.0', msg=dedent("""\ - the behaviour of 'Series.argmax' is deprecated, use 'idxmax' instead. + The current behaviour of 'Series.argmax' is deprecated, use 'idxmax' + instead. The behavior of 'argmax' will be corrected to return the positional maximum in the future. For now, use 'series.values.argmax' or 'np.argmax(np.array(values))' to get the position of the maximum