-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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 incosistent behavior of loc-set with 2 indexes to Series #59333 #60052
base: main
Are you sure you want to change the base?
Conversation
CI is fixed now, can you merge main. |
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.
@mroeschke - I'm not too familiar with this code, this looks okay but am not certain. Can you take a look as well?
pandas/core/indexing.py
Outdated
ser_values = ser.reindex(obj.axes[0][indexer[0]])._values | ||
|
||
# single indexer | ||
if len(indexer) > 1 and not multiindex_indexer: | ||
len_indexer = len(indexer[1]) | ||
if isinstance(indexer[1], slice): | ||
len_indexer = len(obj.loc[indexer[1]].axes[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.
I think you can use axes[1][indexer[1]]
instead of .loc
.
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.
I've made changes requested, but failed test appeared
@anzber - test failures look related. Can you also give this PR an informative title? It is helpful to have titles that give devs a sense of what the PR is doing without having to go open the issue. |
@rhshadrach added more information to title. Thank You for reviewing the code. |
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.
added more information to title
The title of this PR is still Fix issue #59333
.
Will also need a note in the whatsnew for v3.0.0.
@rhshadrach This code fails, but shouldn't : df33 = pd.DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 9]], columns = list("ABC"))
df33.loc[:, pd.Series({"A": True, "B": True, "C": False})] = pd.Series([10, 20, 30])
df33 |
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen. |
Reopening (ref: #60621) |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Comments about pull-request:
Inconsistance with case:
pandas/pandas/tests/indexing/test_indexing.py
Lines 475 to 492 in 05fa958