-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Fix regression in iloc with boolean list #37432
Conversation
Is this early enough to get into 1.1.4? |
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.
Thanks @phofl for the PR. I won't comment on the fix and leave that to @jreback and @jbrockmendel
pandas/tests/indexing/test_iloc.py
Outdated
@@ -767,3 +767,11 @@ def test_iloc_setitem_series_duplicate_columns(self): | |||
) | |||
df.iloc[:, 0] = df.iloc[:, 0].astype(np.float64) | |||
assert df.dtypes.iloc[2] == np.int64 | |||
|
|||
|
|||
def test_iloc_setitem_bool_array(): |
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.
could also be put somewhere in pandas\tests\frame\indexing\
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.
Yeah, that's the file I looked for there :) Thanks
� Conflicts: � pandas/tests/frame/indexing/test_setitem.py
@phofl it appears the test got lost in the merge |
Thanks very much. That was not that clever :) |
code fix is ok, but this is going to be tricky to backport as this code as changed a bit. cc @jbrockmendel merge if looks good to you. |
@@ -229,3 +229,10 @@ def test_setitem_periodindex(self): | |||
rs = df.reset_index().set_index("index") | |||
assert isinstance(rs.index, PeriodIndex) | |||
tm.assert_index_equal(rs.index, rng) | |||
|
|||
def test_iloc_setitem_bool_array(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.
this is actually a list can you parameterize on
[list, np.array]
e.g.
indexer = klass([True, False, False])
df.iloc[indexer, 1] = .....
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.
Good point. Done. Renamed test too.
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
this is fine, thanks @phofl not sure how hard the actual backport to 1.1.4 is |
@meeseeksdev backport 1.1.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
yep this needs manual. @phofl @simonjayhawkins |
(cherry picked from commit 5292533)
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Run tests in
indexes
andindexing
locally without failure.