I\'m experimenting with sympy and I\'ve hit upon an issue I can\'t work out.
Using scipy I can write an expression and evaluate it for an array of x values as follow
While the accepted answer makes it clear that the OP was looking for numerical evaluation, I'll still point out that one can also have symbolic evaluation by using symarray:
import sympy
xs = sympy.symarray('x', 10)
f = lambda x: x**2
f(xs)
yields
array([x_0**2, x_1**2, x_2**2, x_3**2, x_4**2, x_5**2, x_6**2, x_7**2,
x_8**2, x_9**2], dtype=object)
Note that this also uses a numpy array internally, but one filled with sympy.Expressions.