Skip to content
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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

DhruvBShetty
Copy link
Contributor

A test to ensure that .loc assignment of matched and unmatched indices of series yields the right output.

@DhruvBShetty DhruvBShetty changed the title Test loc feature TST: Test .loc #25548 for matched and unmatched indices of Series Nov 29, 2024
Copy link
Member

@mroeschke mroeschke left a 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)

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Dec 2, 2024
# Test unmatched indices
s.loc[["a", "b"]] = s2
tm.assert_series_equal(
s[["a", "b"]], Series([np.nan, np.nan], index=["a", "b"])
Copy link
Member

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"])?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants