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

DEPR/BUG: fix Series.argmin/max #16964

Closed
wants to merge 2 commits into from

Conversation

lphk92
Copy link
Contributor

@lphk92 lphk92 commented Jul 15, 2017

This PR actually implements the proper behavior for argmax() and argmin() for both Series and DataFrame. We will have to wait to rebase this onto master until after a new release.


pytest.raises(ValueError, frame.argmin, axis=2)

def test_argmax(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

use parametrize on these

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These new functions were written to follow the existing structure of the idxmin and idxmax functions. Would you like me to parametrize those functions as well so as to not introduce an inconsistency in the testing methodology?

Copy link
Member

@gfyoung gfyoung Jul 16, 2017

Choose a reason for hiding this comment

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

No, he's referring to the fact that you were using nested for-loops for testing. You can avoid those by parametrizing as illustrated here.

@jreback jreback changed the title Issue 16830 part2 DEPR/BUG: fix Series.argmin/max Jul 15, 2017
@jreback jreback added Deprecate Functionality to remove in pandas Bug labels Jul 15, 2017
@codecov
Copy link

codecov bot commented Jul 16, 2017

Codecov Report

Merging #16964 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16964      +/-   ##
==========================================
+ Coverage   90.98%   90.99%   +<.01%     
==========================================
  Files         161      161              
  Lines       49288    49300      +12     
==========================================
+ Hits        44846    44861      +15     
+ Misses       4442     4439       -3
Flag Coverage Δ
#multiple 88.76% <100%> (+0.02%) ⬆️
#single 40.19% <26.31%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/frame.py 97.77% <100%> (-0.1%) ⬇️
pandas/core/series.py 94.91% <100%> (+0.01%) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/plotting/_converter.py 65.05% <0%> (+1.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96168ef...a71b040. Read the comment docs.

@codecov
Copy link

codecov bot commented Jul 16, 2017

Codecov Report

Merging #16964 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16964      +/-   ##
==========================================
- Coverage   90.99%   90.97%   -0.02%     
==========================================
  Files         161      161              
  Lines       49290    49302      +12     
==========================================
+ Hits        44851    44854       +3     
- Misses       4439     4448       +9
Flag Coverage Δ
#multiple 88.75% <100%> (ø) ⬆️
#single 40.19% <26.31%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/frame.py 97.77% <100%> (-0.1%) ⬇️
pandas/core/series.py 94.91% <100%> (+0.01%) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ffe7fc...5f628c2. Read the comment docs.

@@ -116,6 +116,8 @@ Other API Changes
Deprecations
~~~~~~~~~~~~
- :func:`read_excel()` has deprecated ``sheetname`` in favor of ``sheet_name`` for consistency with ``.to_excel()`` (:issue:`10559`).
- :method:`Series.argmax` has been deprecated in favor of :method:`Series.idxmax` (:issue:`16830`)
- :method:`Series.argmin` has been deprecated in favor of :method:`Series.idxmin` (:issue:`16830`)
Copy link
Member

Choose a reason for hiding this comment

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

Remove these. Refrain from writing anything in the whatsnew until we can agree which version your changes will be applied.

@gfyoung gfyoung added this to the 1.0 milestone Jul 16, 2017
@gfyoung
Copy link
Member

gfyoung commented Jul 16, 2017

Tagging this for 1.0 unless we are doing another 0.2x version after 0.21

@jreback
Copy link
Contributor

jreback commented Jul 21, 2017

I would rather open an issue that references this and mark it for 1.0. Then the PR can be resurrected at that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API: .argmax should be positional, not an alias for idxmax
3 participants