-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG #19860 Corrected use of mixed indexes with .at #22436
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
Conversation
.at incorrectly disallowed the use of integer indexes when a mixed index was used disabled fallback indexing when a mixed index is used
Codecov Report
@@ Coverage Diff @@
## master #22436 +/- ##
=========================================
Coverage ? 92.03%
=========================================
Files ? 169
Lines ? 50780
Branches ? 0
=========================================
Hits ? 46737
Misses ? 4043
Partials ? 0
Continue to review full report at Codecov.
|
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.
looks pretty good. can you add a whatsnew note in bugfixes indexing for 0.24
@@ -666,6 +666,20 @@ def test_index_type_coercion(self): | |||
idxr(s2)['0'] = 0 | |||
assert s2.index.is_object() | |||
|
|||
@pytest.mark.parametrize("index,val", [ |
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.
can you add a comment with the issue number
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.
these tests should be in pandas/tests/indexes/test_base (look for other contains tests)
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.
test_index_not_contains
and test_index_contains
are in the same file a few lines above, should I move these up or create pandas/tests/indexes/test_base and move them there?
@@ -710,6 +724,27 @@ def test_float_index_at_iat(self): | |||
for i in range(len(s)): | |||
assert s.iat[i] == i + 1 | |||
|
|||
def test_mixed_index_at_iat(self): |
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.
move these to pandas/tests/indexing/test_scalar.py (see where other ones are)
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.
add a gh comment with the issue number
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.
can you add the test from the OP (was on dataframe)
s = Series([1, 2, 3, 4, 5], index=['a', 'b', 'c', 1, 2]) | ||
for el, item in s.iteritems(): | ||
assert s.at[el] == item | ||
for i in range(len(s)): |
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.
can you check that we have similar tests for .loc (I think so), if not can you add a loc version (inside same test is ok). maybe even just add the .loc tests and move from elsewhere.
you can parameterize these over .at / .loc
also there might be other .at issues which this closes. pls have a look if you can. cc @toobaz |
Added whatsnew to 0.24 Added issue to tests comments Moved some test Added a test from the issue
Hello @mariuspot! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on August 27, 2018 at 15:41 Hours UTC |
looks good. can you rebase |
looks like you picked up some other commits, do this |
|
Ok, I figured out what went wrong with the merge. Should be ok now |
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.
lgtm. looks like some extraneous rebase issue. ping on green.
doc/source/whatsnew/v0.24.0.txt
Outdated
@@ -659,7 +659,11 @@ Indexing | |||
- Fixed ``DataFrame[np.nan]`` when columns are non-unique (:issue:`21428`) | |||
- Bug when indexing :class:`DatetimeIndex` with nanosecond resolution dates and timezones (:issue:`11679`) | |||
- Bug where indexing with a Numpy array containing negative values would mutate the indexer (:issue:`21867`) | |||
<<<<<<< HEAD |
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.
hve a rebase issue here
lgtm ping on green. |
Looks like travis failed with a segfault on the linker |
@jreback The travis build had a segfault with the linker while setting up the environment. What is the process for that. Is there a way for me to rerun the build or should I make a change and do a new commit? |
thanks! |
.at
incorrectly disallowed the use of integer indexes when a mixed index was usedMade sure fallback indexing doesn't happen on mixed indexes
git diff upstream/master -u -- "*.py" | flake8 --diff