So I am trying to convert a string function expression, to an a function which can take a numpy array ideally.
So far I have this:
import sympy as sp
expr = "x^2 + y^2"
f = sp.sympify(expr)
symbol_list = []
for symbol in f.free_symbols:
symbol = sp.Symbol(str(symbol))
symbol_list.append(symbol)
Now the function f will be able to be used using sp.subs but I want to substitute a numpy array for x, y.
Any ideas?