title: scipy spline interpolation with interp1d IndexError
body: <p>I'm trying to get started with scipy and can't seem to get the example from <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html#scipy.interpolate.interp1d" rel="nofollow">interpolation.interp1d</a> to work when using a kind other than 'linear' (I tried 'zero' and 'cubic'). </p>
  
  <p>I couldn't find someone having the same problem while searching in Google, so I guess it's something stupid on my part.</p>
  
  <p>I use scipy 0.11 on python 2.73 with OSX 10.8</p>
  
  <p>The code not working:</p>
  
  <pre><code>from scipy import interpolate
  import numpy as np
  
  x = np.arange(0, 10)
  y = np.exp(-x/3.0)
  f = interpolate.interp1d(x, y, kind="zero")
  xnew = np.arange(0,9, 0.1)
  ynew = f(xnew)   # use interpolation function returned by `interp1d`
  plt.plot(x, y, 'o', xnew, ynew, '-')
  plt.show()
  </code></pre>
  
  <hr>
  
  <pre><code>IndexError                                Traceback (most recent call last)
  &lt;ipython-input-1-23bb96a1589b&gt; in &lt;module&gt;()
    4 f = interpolate.interp1d(x, y, kind="zero")
    5 xnew = np.arange(0,9, 0.1)
  ----&gt; 6 ynew = f(xnew)   # use interpolation function returned by `interp1d`
    7 plt.plot(x, y, 'o', xnew, ynew, '-')
    8 plt.show()
  
  /usr/local/lib/python2.7/site-packages/scipy/interpolate/interpolate.pyc in __call__(self, x_new)
  394         out_of_bounds = self._check_bounds(x_new)
  395 
  --&gt; 396         y_new = self._call(x_new)
  397 
  398         # Rotate the values of y_new back so that they correspond to the
  
  /usr/local/lib/python2.7/site-packages/scipy/interpolate/interpolate.pyc in _call_spline(self, x_new)
  370     def _call_spline(self, x_new):
  371         x_new =np.asarray(x_new)
  --&gt; 372         result = spleval(self._spline,x_new.ravel())
  373         return result.reshape(x_new.shape+result.shape[1:])
  374 
  
  /usr/local/lib/python2.7/site-packages/scipy/interpolate/interpolate.pyc in spleval((xj, cvals, k), xnew, deriv)
  833             res[sl].imag = _fitpack._bspleval(xx,xj,cvals.imag[sl],k,deriv)
  834         else:
  --&gt; 835             res[sl] = _fitpack._bspleval(xx,xj,cvals[sl],k,deriv)
  836     res.shape = oldshape + sh
  837     return res
  
  IndexError: too many indices
  </code></pre>
  
  <p>When starting the debug console here i can narrow it down to cvals[sl] causing the error with</p>
  
  <pre><code>sl = (slice(None, None, None), 0) # &lt;-- I don't really get the slice part here...
  cvals = array([ 1.        ,  0.71653131,  0.51341712,  0.36787944,  0.26359714,
      0.1888756 ,  0.13533528,  0.09697197,  0.06948345])
  </code></pre>
  
  <p>Can someone reproduce this or is something wrong on my machine?</p>