title: Index error with scipy.interpolate.interp1d
body: <p>I am trying to get a cubic spline working with the scipy.interpolate.interp1d function. I tried to get the example on the <a href="http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html" rel="nofollow">documentation page</a> working, but whenever I run it I get this error: </p>
  
  <blockquote>
    <p>plt.plot(x,y,'o',xnew,f(xnew),'-', xnew, f2(xnew),'--')   File
    "/Library/Python/2.7/site-packages/scipy-0.12.0.dev_ddd617d_20120920-py2.7-macosx-10.8-x86_64.egg/scipy/interpolate/interpolate.py",
    line 396, in <strong>call</strong>
        y_new = self._call(x_new)   File "/Library/Python/2.7/site-packages/scipy-0.12.0.dev_ddd617d_20120920-py2.7-macosx-10.8-x86_64.egg/scipy/interpolate/interpolate.py",
    line 372, in _call_spline
        result = spleval(self._spline,x_new.ravel())   File "/Library/Python/2.7/site-packages/scipy-0.12.0.dev_ddd617d_20120920-py2.7-macosx-10.8-x86_64.egg/scipy/interpolate/interpolate.py",
    line 835, in spleval
        res[sl] = _fitpack._bspleval(xx,xj,cvals[sl],k,deriv) IndexError: too many indices</p>
  </blockquote>
  
  <p>So, it works with the linear interpolation but not with the cubic. I'm probably making some silly error, but I can't figure out what's going wrong. Here is the code for the example that I am using:</p>
  
  <pre><code>import numpy as np
  from scipy.interpolate import interp1d
  
  x = np.linspace(0, 10, 40)
  y = np.cos(-x**2/8.0)
  f = interp1d(x, y)
  f2 = interp1d(x, y, kind='cubic')
  
  xnew = np.linspace(0, 10, 10)
  import matplotlib.pyplot as plt
  plt.plot(x,y,'o',xnew,f(xnew),'-', xnew, f2(xnew),'--')
  plt.legend(['data', 'linear', 'cubic'], loc='best')
  plt.show() 
  </code></pre>