-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: Categorical setitem, comparison with tuple category #36623
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
Conversation
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 - can you add a whatsnew?
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 @TomAugspurger
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 you also check getitem?
@@ -1883,7 +1885,8 @@ def _validate_setitem_value(self, value): | |||
new_codes = self._validate_listlike(value) | |||
value = Categorical.from_codes(new_codes, dtype=self.dtype) | |||
|
|||
rvalue = value if is_list_like(value) else [value] | |||
# wrap scalars and hashable-listlikes in list | |||
rvalue = value if not is_hashable(value) else [value] |
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 use maybe_make_list
(but certainly can followup as may need to change that definition slightly)
not sure i follow. you mean check that |
ok then. |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff