Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC/DEPR: clarify argmin/argmax deprecation message #22310

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize "the". And maybe add the current behavior.

LGTM otherwise.

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):
Expand Down