-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
TST/DEPR: remove .ix from tests\indexing\multiindex\test_loc.py #26451
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
TST/DEPR: remove .ix from tests\indexing\multiindex\test_loc.py #26451
Conversation
|
@simonjayhawkins can you rebase |
Codecov Report
@@ Coverage Diff @@
## master #26451 +/- ##
==========================================
- Coverage 91.74% 91.73% -0.01%
==========================================
Files 174 174
Lines 50746 50746
==========================================
- Hits 46555 46551 -4
- Misses 4191 4195 +4
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26451 +/- ##
==========================================
- Coverage 91.74% 91.73% -0.01%
==========================================
Files 174 174
Lines 50746 50748 +2
==========================================
- Hits 46555 46553 -2
- Misses 4191 4195 +4
Continue to review full report at Codecov.
|
jreback
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally we don't want to use DataFrame.values instead prefer .iloc
| xp = mi_labels.ix['i'] | ||
| tm.assert_frame_equal(rs, xp) | ||
| # the first 2 rows | ||
| expected = DataFrame( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use .iloc
| xp = mi_labels.ix[:, 'j'] | ||
| tm.assert_frame_equal(rs, xp) | ||
| # 2nd (last) column | ||
| expected = DataFrame(df.values[:, [2]], index=df.index, columns=['B']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, don't directly use .values
and then follow with |
yes I think the 2nd is more idiomatic |
|
the straight sub fails a couple of tests, i've just commited that to show the failing cases. next commit using droplevel. |
|
thanks @simonjayhawkins nice clean up! |
follow on from #26438
i leave this as draft until #26438 is merged, to prevent this one being merged first.
not used
ilocfor the expected where dropping levels would be required, used df.values instead.