Skip to content

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

Merged
merged 19 commits into from
Jun 30, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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
Contributor 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