-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ERR: better error reporting for missing numexpr #5969
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
You must have a or b defined somewhere in scope (that is the meaning of the error) |
What do you mean by "in scope"? My understanding is that it will assume 'a' and 'b' are columns of the df. Do I have to have 'a' and 'b' defined as python variables somwhere? |
This is quite weird, I now purged pandas and reinstalled and now I get:
|
what I mean is if a or b is defined as a local variable before this call it will complain
you can pass |
Oh, I see. yes, that makes sense. Although now I am getting the second error (AttributeError: 'module' object has no attribute 'evaluate') in a clean interpreter. |
I wonder if this error message could be a bit more transparent. When I wrote this it made perfect sense, but now that 0.13 is out and |
Maybe something along the lines of,
|
maybe also have easy way to turn this off, e.g. |
maybe should be off by default? |
Resolvers is more general (since you don't have to use a @twiecki As a side note, if you want to use the local variable a = 5
df.query('@a > b') |
Hm like |
Any thoughts on my current problem #5969 (comment)? |
@twiecki |
I installed with |
Not there
|
in your pandas dir just do python ci/print_versions.py |
and from now on #5976 |
@y-p awesome thanks |
@twiecki Fixed? Or can you get those versions up? |
@cpcloud not fixed, here's the output:
|
@twiecki you must be loading something else, try in a vanilla python session
|
ahh...I see that you don't have @cpcloud I guess that's an edge case / better error message needed |
But then why was it giving errors about |
@jreback In any case, yes a better error message |
@cpcloud could it be falling back to the PythonEngine? (and taking an odd path) |
Yes, installing |
@cpcloud ok...changed the name of this example....hmm...the 2.6 build prob skipped this test (but should check for the error I guess) |
@jreback Should I open another issue for the locals option? |
sure....api? |
Require explicit references for locals via My 2c. |
@cpcloud yeh...i am thinking that its too magical now...(we have the reverse of what @y-p is suggesting), using '@' for conflicts. let's change to make '@' represent an explicit external variable, otherwise assume internal name references so this will work just fine
this will uses the b=1
And this should work as well
This will break prior behavior, but this IS experimental! if the |
We got way OT here. #5855 should take care of the numexpr warning. |
Indeed was just about comment ... |
@twiecki When you encountered this error did you happen to have the |
@cpcloud there was no |
Right. But it shouldn't have gotten past the second line of |
It's possible that I perhaps had a very outdated |
@twiecki maybe < than 2.0? |
If it was an older version it could have been very old. |
closed by #6109 |
From the example at http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.query.html:
gives me:
This is with
0.13
.The text was updated successfully, but these errors were encountered: