I have been experimenting and trying to learn the Numexpr package. Examples on how to use it are sparse at best. Can someone please give me a quick example on how to use the “local_dict” and “global_dict” arguments?
I have been experimenting and trying to learn the Numexpr package. Examples on how
Share
The following examples may clarify it a little. First set up the scene like this:
No
dictWhen you run it like this,
aandbare the local variables, andcis the global variable, as expected.local_dictBecause we have redefined
local_dict,aandbno longer show up there as local variables, so the value of the global ones is used instead. And becausecnow is defined as a local variable, the value of the global one is ignored.global_dictIn this case,
aandbare taken from the default local dictionary, and the newcis taken in place of the original global one.