-
Notifications
You must be signed in to change notification settings - Fork 103
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
Boolean "~" operator ignored after "|" #60
Comments
This is a tricky one. I'll have to dive into it a little bit to see what's going on. The |
Ok so this is definitely a bug, but I'm gonna need to think about how I'll fix it. Essentially the problem is that the inversion is not propagating through properly in the chain of operations, and unfortunately it's not a trivial fix as far as I can tell right now. I'll let you know when I come up with a solution. |
Hi Kieferk, |
Just wanted to chime in that I have also come across this bug, same scenario when using |
Also wanted to add that in the case of |
Sorry I've been inactive for awhile since work has been very busy. I am going to dive back in and try to tackle this over the weekend. I am hoping I can resolve this "elegantly" but from what I can see it may require some substantial code re-writing. I'll keep you posted. |
interestingly, passing the invert operator to from operator import inv # inv(x) == ~x
df['a'].isnull() | (~df['b'].isnull())
# m
# 0 True
# 1 True
# 2 True
# 3 True
# 4 False
df >> transmute(m = X.a.isnull() | inv(X.b.isnull()))
# m
# 0 True
# 1 False
# 2 False
# 3 False
# 4 True
df >> transmute(m = X.a.isnull() | make_symbolic(inv)(X.b.isnull()))
# m
# 0 True
# 1 True
# 2 True
# 3 True
# 4 False |
Hi kieferk, My friends and I are very excited and thankful when encounting the dplyr-style package. |
Hi kieferk,
I am an R user learning how to use
dfply
. I may have spotted an issue: it appears that Boolean~
isn't evaluated after Boolean|
if applied in the syntax below.My code:
Here is the original data frame, df:
And here is the result of the piped mask, df2:
However, I expect this instead:
I don't understand why the
|
and~
operators result in rows in which column "a" is eitherNaN
or column "b" is notNaN
?By the way, I also tried
np.logical_or()
:But this resulted in error:
The text was updated successfully, but these errors were encountered: