-
Notifications
You must be signed in to change notification settings - Fork 389
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
Change the like API to behave like a predicate #1340
Conversation
…olean array-likes so update the implementation accordingly
@llllllllll @cowlicks any comments here? |
@llllllllll @cowlicks probably going to merge this soon |
@@ -267,7 +267,9 @@ def compute_up(t, x, **kwargs): | |||
|
|||
@dispatch(Selection, np.ndarray) | |||
def compute_up(sel, x, **kwargs): | |||
return x[compute(sel.predicate, {sel._child: x})] | |||
predicate = compute(sel.predicate, {sel._child: x}) | |||
cond = getattr(predicate, 'values', predicate) |
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.
Why would this become a series?
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.
Because the like
operation is done in the pandas backend
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 am trying to find where the ndarray gets coerced into a series for the Like
to dispatch properly
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.
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 didn't realize numpy fell back to pandas. This makes much more sense, thanks
merging on pass |
Change the like API to behave like a predicate
closes #1333