Skip to content

Inconsistent DataFrame.query results #12357

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

Closed
mattytrentini opened this issue Feb 16, 2016 · 3 comments
Closed

Inconsistent DataFrame.query results #12357

mattytrentini opened this issue Feb 16, 2016 · 3 comments
Labels
Compat pandas objects compatability with Numpy or Python functions Windows Windows OS

Comments

@mattytrentini
Copy link

Having seen some inconsistent results from processing DataFrames - literally, running scripts over static data would generate different outcomes - we were able to boil down the following example:

def compare(df):
    df1 = df.query('x < 2000')
    df2 = df.query('x < 2000')
    return df1.equals(df2)

If I understand correctly, calling compare should never return false and yet it does, randomly:

>>> df = pd.DataFrame({'x': range(100000), 'y': range(100000)})
>>> for i in xrange(1000):
...     if not compare(df):
...         print ('failed at iteration', i)
...
failed at iteration 10
failed at iteration 66
failed at iteration 80
failed at iteration 141
failed at iteration 149
            ...
failed at iteration 878
failed at iteration 999

This seems like a defect in query?

Relevant versions:

>python --version
Python 2.7.11 :: Anaconda 2.4.0 (64-bit)
>systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type"
OS Name:                   Microsoft Windows 8.1 Pro
OS Version:                6.3.9600 N/A Build 9600
System Type:               x64-based PC
@jreback jreback added Windows Windows OS Compat pandas objects compatability with Numpy or Python functions labels Feb 16, 2016
@jreback
Copy link
Contributor

jreback commented Feb 16, 2016

duplicate of this

install numexpr=>2.4.6 and all will be well

usually conda update numexpr will suffice

@jreback jreback closed this as completed Feb 16, 2016
@mattytrentini
Copy link
Author

Thanks!

Sorry to waste your time, I did search but didn't stumble on the other duplicates.

Always nice to see an issue resolved and closed in less time than it took to write! :)

@jreback
Copy link
Contributor

jreback commented Feb 17, 2016

hah, yeah have seen this one a number of times. Not much we can do until Anaconda updates the version. To be more insidious, this is ONLY on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Windows Windows OS
Projects
None yet
Development

No branches or pull requests

2 participants