title: Evaluating a numpy array
body: <p>I have a function that returns a numpy array as follows:</p>
  <pre><code>import numpy as np
  from scipy.misc import derivative
  import sympy as sp
  
  x, y = sp.symbols('x y')
  f = x**2 + y **2
  def grad(f):
      exp = sp.expand(f)
      dfdx = sp.diff(exp,x)
      dfdy = sp.diff(exp,y)
      global grad
      Df = np.array([dfdx,dfdy])
      return Df
  </code></pre>
  <p>I'm using the variable <code>Df</code> in another function and do some computations with it.</p>
  <p>As you may have guessed, the results come out including <code>x</code> and <code>y</code>. However, I need the results to be evaluated each time with the initial values I choose for <code>x</code> and <code>y</code> instead of the symbols.</p>
  <p>I was wondering if there was something like the <code>.subs()</code> in sympy but works on a numpy array rather than a function????</p>