I would also expect this to be easier to do, but here's a good way:
If you know the character names ( 'x' , 'y' , for example), you can create a dict on the fly using zip :
fvars = sympy.symbols('x, y') #these probably already exist, use: fvars = [x,y] b = [1,2] sympy.evalf(f, subs = dict(zip(fvars,b)))
askewchan
source share