title: AttributeError: module 'scipy.interpolate' has no attribute 'spline'
body: <p>I'm using Python 3.6 and trying to run the following code which is from <a href="https://stackoverflow.com/questions/14344099/smooth-spline-representation-of-an-arbitrary-contour-flength-x-y/18091373#18091373">here</a>:</p>
  
  <pre><code>from __future__ import division
  import numpy as np
  import matplotlib.pyplot as plt
  import scipy.interpolate
  
  x = np.array([ 2.,  1.,  1.,  2.,  2.,  4.,  4.,  3.])
  y = np.array([ 1.,  2.,  3.,  4.,  2.,  3.,  2.,  1.])
  plt.plot(x,y, label='poly')
  
  t = np.arange(x.shape[0], dtype=float)
  t /= t[-1]
  nt = np.linspace(0, 1, 100)
  x1 = scipy.interpolate.spline(t, x, nt)
  y1 = scipy.interpolate.spline(t, y, nt)
  plt.plot(x1, y1, label='range_spline')
  
  t = np.zeros(x.shape)
  t[1:] = np.sqrt((x[1:] - x[:-1])**2 + (y[1:] - y[:-1])**2)
  t = np.cumsum(t)
  t /= t[-1]
  x2 = scipy.interpolate.spline(t, x, nt)
  y2 = scipy.interpolate.spline(t, y, nt)
  plt.plot(x2, y2, label='dist_spline')
  
  plt.legend(loc='best')
  plt.show()
  </code></pre>
  
  <p>But it generates an error, <code>AttributeError: module 'scipy.interpolate' has no attribute 'spline'</code>.</p>
  
  <p>Then I modify to the following by import <code>make_interp_spline</code> from <code>scipy.interpolate</code>: </p>
  
  <pre><code>from __future__ import division
  import numpy as np
  import matplotlib.pyplot as plt
  import scipy.interpolate
  from scipy.interpolate import make_interp_spline
  
  x = np.array([ 2.,  1.,  1.,  2.,  2.,  4.,  4.,  3.])
  y = np.array([ 1.,  2.,  3.,  4.,  2.,  3.,  2.,  1.])
  plt.plot(x,y, label='poly')
  
  t = np.arange(x.shape[0], dtype=float)
  t /= t[-1]
  nt = np.linspace(0, 1, 100)
  x1 = make_interp_spline(t, x, nt)
  y1 = make_interp_spline(t, y, nt)
  plt.plot(x1, y1, label='range_spline')
  
  t = np.zeros(x.shape)
  t[1:] = np.sqrt((x[1:] - x[:-1])**2 + (y[1:] - y[:-1])**2)
  t = np.cumsum(t)
  t /= t[-1]
  x2 = make_interp_spline(t, x, nt)
  y2 = make_interp_spline(t, y, nt)
  plt.plot(x2, y2, label='dist_spline')
  
  plt.legend(loc='best')
  plt.show()
  </code></pre>
  
  <p>I get an new error <code>ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()</code>.</p>
  
  <p>Out:</p>
  
  <pre><code>---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-9-2b54020d8fb1&gt; in &lt;module&gt;
       12 t /= t[-1]
       13 nt = np.linspace(0, 1, 100)
  ---&gt; 14 x1 = make_interp_spline(t, x, nt)
       15 y1 = make_interp_spline(t, y, nt)
       16 plt.plot(x1, y1, label='range_spline')
  
  /usr/local/lib/python3.7/site-packages/scipy/interpolate/_bsplines.py in make_interp_spline(x, y, k, t, bc_type, axis, check_finite)
      751 
      752     # special-case k=0 right away
  --&gt; 753     if k == 0:
      754         if any(_ is not None for _ in (t, deriv_l, deriv_r)):
      755             raise ValueError("Too much info for k=0: t and bc_type can only "
  
  ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  </code></pre>
  
  <p>Just wonder how to fix this issue? Thank you.</p>