I tried out this to get the expression
>>> from sympy import symbols
>>> from sympy.utilities.autowrap import ufuncify
>>> x=symbols('x')
>>> expr=x**2 +x**4 +1
>>> binary_fu=ufuncify(x, expr)
>>> binary_fu(x)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: ufunc 'wrapper_module_0' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
This is expected because a ufunc will expect an array. Is there a way to get the expression once one has ufuncified it?
(This is trivial in case of lambify)
>>> lambdified_poly=lambdify(x,expr)
>>> lambdified_poly(x)
x**4 + x**2 + 1
Please help me.