Skip to content

ENH: Improve DataFrame loc indexing #138

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 2 commits into from
Jul 15, 2022
Merged

Conversation

bashtage
Copy link
Contributor

Allow any scalar types in .loc to return a Series

xref #133

  • Closes N/A but makes forward progress
  • Tests added: Please use assert_type() to assert the type of any return value

@bashtage bashtage requested a review from Dr-Irv July 13, 2022 22:37
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

  1. I suggested combining the 3 overloads, but if that doesn't work with the current tests, then you can leave it as is.
  2. Can you add tests for all the types in Scalar to see if they are valid column names?

Allow any scalar types in .loc to return a Series

xref pandas-dev#133
@bashtage
Copy link
Contributor Author

All scalar types work as expected.

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

one small change

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

Thanks @bashtage

@Dr-Irv Dr-Irv merged commit cb0bcac into pandas-dev:main Jul 15, 2022
@bashtage bashtage deleted the issue-133 branch July 15, 2022 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants