Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BUG: Fix return type of loc/iloc #61054

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
Loading
from
Prev Previous commit
Next Next commit
Fix test_loc_dtype
  • Loading branch information
sanggon6107 committed Mar 4, 2025
commit c5a5de160728684a3583a2afb3e8bc64ab8e7bde
2 changes: 1 addition & 1 deletion 2 pandas/tests/indexing/test_loc.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_loc_dtype():
df = DataFrame([["a", 1.0, 2.0], ["b", 3.0, 4.0]])
result = df.loc[0, [1, 2]]
expected = df[[1, 2]].loc[0]
Copy link
Member

Choose a reason for hiding this comment

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

Can you provide expected explicitly here: expected = DataFrame(...)

Copy link
Author

Choose a reason for hiding this comment

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

Made the code change. Thanks for the suggestion!

tm.assert_frame_equal(result, expected)
tm.assert_series_equal(result, expected)


class TestLoc:
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.