-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -818,15 +818,15 @@ def test_iloc_setitem_bool_indexer(self, klass): | |
tm.assert_frame_equal(df, expected) | ||
|
||
@pytest.mark.parametrize("indexer", [[1], slice(1, 2)]) | ||
def test_setitem_iloc_pure_position_based(self, indexer): | ||
def test_iloc_setitem_pure_position_based(self, indexer): | ||
# GH#22046 | ||
df1 = DataFrame({"a2": [11, 12, 13], "b2": [14, 15, 16]}) | ||
df2 = DataFrame({"a": [1, 2, 3], "b": [4, 5, 6], "c": [7, 8, 9]}) | ||
df2.iloc[:, indexer] = df1.iloc[:, [0]] | ||
expected = DataFrame({"a": [1, 2, 3], "b": [11, 12, 13], "c": [7, 8, 9]}) | ||
tm.assert_frame_equal(df2, expected) | ||
|
||
def test_setitem_iloc_dictionary_value(self): | ||
def test_iloc_setitem_dictionary_value(self): | ||
# GH#37728 | ||
df = DataFrame({"x": [1, 2], "y": [2, 2]}) | ||
rhs = dict(x=9, y=99) | ||
|
@@ -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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
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.
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 commentThe 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 |
||
# GH#22046 | ||
ser1 = Series([1, 2, 3]) | ||
ser2 = Series([4, 5, 6], index=[1, 0, 2]) | ||
|
Uh oh!
There was an error while loading. Please reload this page.