-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: Add comment and clarify if condition in indexing #37960
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
@@ -1000,7 +1000,7 @@ def test_iloc_getitem_nonunique(self): | |||
ser = Series([0, 1, 2], index=[0, 1, 0]) | |||
assert ser.iloc[2] == 2 | |||
|
|||
def test_setitem_iloc_pure_position_based(self): | |||
def test_iloc_setitem_pure_position_based(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.
the comment about test naming applied to a few tests in the previous PR.
BTW i have a branch called "collect" in which i collect small edits that dont necessarily merit their own PRs, then periodically make a PR titled "assorted cleanups"
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.
Ah yeah you are right :)
When I started contributing someone told me to try avoiding cluttering things together in one pr, which belong to different prs, so I tried to split everything up as good as possible.
Will collect clean ups in the future :)
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.
When I started contributing someone told me to try avoiding cluttering things together in one pr, which belong to different prs, so I tried to split everything up as good as possible.
In general this is good advice. For the "assorted cleanups" PRs its important that the changes be pretty purely cosmetic so that they are super-easy to review.
Will collect clean ups in the future :)
It works for me but not for everyone. You find what works for you.
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 for the help. Will try to collect them in the future if this is doable
pandas/core/indexing.py
Outdated
@@ -1859,6 +1859,7 @@ def _setitem_with_indexer_missing(self, indexer, value): | |||
if index.is_unique: | |||
new_indexer = index.get_indexer([new_index[-1]]) | |||
if (new_indexer != -1).any(): | |||
# We get only in this method with loc, so can hard 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.
"in this method" -> "here"
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.
Changed,
small comments, ping on green |
@jbrockmendel green |
thanks @phofl |
Implemented comments
cc @jbrockmendel