Skip to content

is it possible to use numpy math function through local_dict #509

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

Open
westNeighbor opened this issue Apr 22, 2025 · 1 comment
Open

is it possible to use numpy math function through local_dict #509

westNeighbor opened this issue Apr 22, 2025 · 1 comment

Comments

@westNeighbor
Copy link

I want to use numpy's math function and I try:
evaluate("log2(x)", {"log2": numpy.log2}), it gives errors.

@gdementen
Copy link
Contributor

gdementen commented Apr 23, 2025

No, local_dict is only for data. Each function supported by numexpr must have specific code in the library. It would be theoretically possible to implement a mechanism to let users define custom element-wise functions, but this would probably kill performance and it does not exist at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants