-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
API: Disallow DataFrame other for Series flex ops #62648
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
|
Thanks @jbrockmendel |
| result = self._binop(other, op, level=level, fill_value=fill_value) | ||
| result._name = res_name | ||
| return result | ||
| elif isinstance(other, ABCDataFrame): |
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.
Actually last minute thought, would be worth still allowing this if the axis are already aligned?
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.
so just revert and let non-aligned cases raises like before? maybe try to give a better message?
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.
Or if ser.flex_op(df, axis=0) gives a sensible result when ser.index.equals(df.index), just have a follow up PR to amend and not ser.index.equals(df.index) to this elif. I suppose it would be good to also have a test case for ser.flex_op(df, axis=0) when the indexes are aligned
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.
i think "DataFrame is not allowed" is significantly simpler to communicate than "DataFrame is not allowed except when aligned"
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.
Yeah definitely. We can keep this as is and reconsider if anyone seriously complains
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.