title: Integrating over an interpolate function (interp1d) in python
body: <p>I am trying to do double integration over an interpolated function, in which <code>r = r(x,y)</code>.</p>
  
  <pre><code>from scipy import interpolate
  import scipy as sp
  
  r = [0, 1, 2]
  z = [0, 1, 2]
  
  def cartesian(x, y, f):
      r = sp.sqrt(x**2 + y**2)
      return f(r)
  
  interp = interpolate.interp1d(r, z)
  
  print(cart(1,1,interp))
  
  a = sp.integrate.dblquad(cart, 0, 1, lambda x: 0, lambda x: 1, args=(interp))
  print(a)
  </code></pre>
  
  <p>Executing the Cartesian function once produces the correct answer. However the integral gives the the following error:</p>
  
  <pre><code>TypeError: integrate() argument after * must be an iterable, not interp1d
  </code></pre>
  
  <p>I don't understand why my function isn't <code>iterable</code> and do not know how to convert it into an <code>iterable</code> form. Many thanks for any help.</p>