Skip to content
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

Inf in query / eval #7178

Closed
amelio-vazquez-reina opened this issue May 19, 2014 · 5 comments · Fixed by #7181
Closed

Inf in query / eval #7178

amelio-vazquez-reina opened this issue May 19, 2014 · 5 comments · Fixed by #7181
Labels
Milestone

Comments

@amelio-vazquez-reina
Copy link
Contributor

In df.eval() or df.query(), is there any way to run comparisons against np.Inf?

When I do:

temp_df.eval('my_col < Inf') or
temp_df.eval('my_col < np.Inf') or

I get UndefinedVariableError

@amelio-vazquez-reina amelio-vazquez-reina changed the title Inf or np.Inf in query / eval Inf in query / eval May 19, 2014
@cpcloud
Copy link
Member

cpcloud commented May 19, 2014

Just needs to be added to the global constants.

@amelio-vazquez-reina
Copy link
Contributor Author

Thanks @cpcloud What do you mean? Is this something specific to numexpr or Pandas?

@cpcloud
Copy link
Member

cpcloud commented May 19, 2014

I can do this in an hour or so if you look in computation/scope.py and want to take a crack at it before then please do.

@cpcloud
Copy link
Member

cpcloud commented May 19, 2014

@ribonoous sorry about the above explanation; I didn't mean to be so cryptic. The reason this fails is actually because the "builtins" to eval are not looked up correctly (which is actually a bug). If you can't wait for the fix to be merged just slap an @ on the front of inf and as long as it's defined in the scope where you call eval / query you're golden.

@amelio-vazquez-reina
Copy link
Contributor Author

Great. That makes sense. Thanks @cpcloud

@jreback jreback added the Bug label May 20, 2014
@jreback jreback added this to the 0.14.0 milestone May 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants