-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: is_scalar_indexer #32850
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
BUG: is_scalar_indexer #32850
Conversation
Is there an actual bug that this fixes? (do you have an example with indexing that now did the wrong thing?) |
Nothing user-facing, just an unnecessary failed-cast:
ATM this incorrectly doesnt see the indexer as a scalar-indexer, but does see this (also incorrectly) as an |
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.
small comment, otherwise lgtm.
pandas/core/internals/blocks.py
Outdated
values = values.astype(arr_value.dtype) | ||
except ValueError: | ||
pass | ||
values = values.astype(arr_value.dtype) |
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.
can add copy=False here I think
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.
lgtm. merge on green.
* BUG: is_scalar_indexer * update docstring * add copy=False
* BUG: is_scalar_indexer * update docstring * add copy=False
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
ATM we go through the wrong path when setting a listlike entry in a single position.
The broader goal: separate out the cases where setitem is inplace vs copying.