I am trying to make lambdify understand to expect more than one type of input using the modules keyword argument. According to the source code of lambdify (http://docs.sympy.org/dev/_modules/sympy/utilities/lambdify.html), this can be done by using lists of the arguments, but i am not able to do so.
import sympy
from sympy import lambdify
x,y=sympy.symbols('x y')
from sympy.parsing.sympy_parser import parse_expr
func=lambdify(x,parse_expr(exp(x)),modules=["numpy","sympy"])
func(array([3,4]))
gives
array([ 20.08553692, 54.59815003])
but when i try
func(y)
i get an
Attribute error:exp
What am i doing wrong here? Shouldn't func accept both numpy and sympy types? Any help appreciated!!