I am implementing the code in python which has the variables stored in numpy vectors. I need to perform simple operation: something like (vec1+vec2^2)/vec3. Each element of each
Using numexpr, then you could do this:
In [143]: import numexpr as ne In [146]: ne.evaluate('2*a*(b/c)**2', local_dict=var) Out[146]: array([ 0.88888889, 0.44444444, 4. ])