-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: Series/Index arithmetic result names with NAs #44459
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
else: | ||
# TODO: what if they both have np.nan for their names? | ||
try: | ||
if a.name == b.name: |
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.
are we somehow raising on NA comparing to a string?
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.
if either is pd.NA then this raises TypeError
looks fine can you add a whatsnew note |
whatsnew added + greenish |
Certainly no objection to the modification here, but I do wonder if we should be changing the API to narrow what is allowed as a Series name or DataFrame label. For example, from #39757,
still fails. I am wondering if we should change the API to only allow basic primitive types (Boolean, int, str, float?, perhaps some others) and tuples of primitive types, rather than trying to chase these issues down. |
the problem is that the name can be any pandas primitive or tuplr if those (as we allow this for index labels) which doesn't it much |
@jreback - I think you're saying that even if we were to add some restrictions, |
yes ultimately we allow these as names (well have to be hashable) or we could inhibit a number of downstream ops |
_maybe_match_name
) #22041