-
-
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
TST: Test .loc #25548 for matched and unmatched indices of Series #60450
base: main
Are you sure you want to change the base?
Conversation
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 you just use the example directly from the issue? #25548 (comment)
pandas/tests/indexing/test_loc.py
Outdated
# Test unmatched indices | ||
s.loc[["a", "b"]] = s2 | ||
tm.assert_series_equal( | ||
s[["a", "b"]], Series([np.nan, np.nan], index=["a", "b"]) |
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 you assign result = s[["a", "b"]]
and expected = Series([np.nan, np.nan], index=["a", "b"])
?
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.
Sure 👍
Added type annotations to new arguments/methods/functions.Added an entry in the latestdoc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.A test to ensure that .loc assignment of matched and unmatched indices of series yields the right output.