-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Dispatch Index ops to Series #27352
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
Dispatch Index ops to Series #27352
Conversation
Looks reasonable. What's the ideal final state? For future mico-optimization, I could imagine an implementation that does index-specific things (e.g. deferring for |
|
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.
looks good, minor comments ping on green. note still want to move things out of pandas/core/ops/init.py to a named module.
pandas/core/ops/__init__.py
Outdated
elif isinstance(right, (ABCDatetimeArray, pd.DatetimeIndex)): | ||
result = op(left._values, right) | ||
return construct_result(left, result, index=left.index, name=res_name) | ||
|
||
lvalues = left.values | ||
rvalues = right | ||
if isinstance(rvalues, ABCSeries): |
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.
these cases are the same, yes?
isinstance(rvalues, (ABCSeries, ABCIndexClass))
pandas/core/ops/missing.py
Outdated
left : object (Index for non-reversed ops) | ||
right : object (Index fof reversed ops) | ||
left : object (np.ndarray for non-reversed ops) | ||
right : object (np.ndarray fof reversed ops) |
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.
fof -> for
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.
fixed+green
thanks @jbrockmendel |
Getting ever closer to a single implementation.