-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DataFrame.query gives false positives #11743
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
Comments
pls include a This is prob a floating point issue. |
Also happens with a dataframe containing strings: testdf=pd.DataFrame([("one","two")]*10000)
testdf.columns=['a','b'] found_count = 0
for i in xrange(10000):
qq = testdf.query('a=="three"')
if not qq.empty:
print "Value found"
found_count += 1
print "Times found: {}".format(found_count)
>>>Value found
>>>Value found
>>>Value found
>>>...
>>>Times found: 13 |
pls show this is not reproducible on master |
|
so it might be I have quite similar versions of these packages & have not been able to repro on 0.17,0.17.1, or master does it always happen? |
Tried it on a different machine and also on a fresh |
then its almost certainly |
I just reinstalled latest version of Anaconda which has numexpr 2.4.4 and then this started happening. Like OP, It happens very rarely and very hard to reproduce. I had previously other issues with 2.4.4 but 2.4.6 has been ok so far. |
Versions for the record. INSTALLED VERSIONScommit: None pandas: 0.17.1 |
closing as this is a numexpr issue. maybe we should put in a doc-warning that we recommend > 2.4.6, though not available on conda...hmm I'll push on that. so if anyone wants to put up a PR for |
Noticing some strange behaviour when using the
query
method. I'm expecting empty results from the query but once in a while I'm getting a non-empty dataframe returned.Doing this 10000 times with using the classical way:
Using query:
or
The number of non-empty results varies but tends to happen 0.2% of the time. Is this a bug or have I misunderstood what
query
is supposed to to? Version is0.17.0
.The text was updated successfully, but these errors were encountered: