title: Scipy Interpolate PiecewisePolynomial - Error on input data
body: <p>Hello I am using the following code to try to use scipy's interpolation.</p>
  
  <p>I am getting the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 3.4.1\helpers\pydev\pydevd.py", line 1733, in &lt;module&gt;
      debugger.run(setup['file'], None, None)
    File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 3.4.1\helpers\pydev\pydevd.py", line 1226, in run
      pydev_imports.execfile(file, globals, locals)  # execute the script
    File "C:/Users/%user%/PycharmProjects/price_options_multithread/curve_interpolation.py", line 81, in &lt;module&gt;
      tck = interpolate.PiecewisePolynomial(moneyness_,vols_, orders = 2)
    File "C:\Users\%user%\Miniconda\lib\site-packages\scipy\interpolate\polyint.py", line 731, in __init__
      self._set_yi(yi0)
    File "C:\Users\%user%\Miniconda\lib\site-packages\scipy\interpolate\polyint.py", line 131, in _set_yi
      self._y_axis = (axis % yi.ndim)
  ZeroDivisionError: integer division or modulo by zero
  </code></pre>
  
  <p>With the code to call the interpolation reading as:</p>
  
  <pre><code>tck = interpolate.PiecewisePolynomial(X,Y, orders = 2)
  </code></pre>
  
  <p>Where Y is:</p>
  
  <pre><code>[0.2015, 0.3469, 0.2985, 0.2113, 0.19989999999999997, 0.4262, 0.21355000000000002, 0.22260000000000002, 0.21194999999999997, 0.1846, 0.2627, 0.2058, 0.2276, 0.21715, 0.23099999999999998, 0.20235, 0.2165, 0.21165, 0.3836, 0.19594999999999999, 0.20450000000000002, 0.20375, 0.20145000000000002, 0.23525000000000001, 0.2242, 0.22645, 0.27455, 0.22425, 0.2232, 0.1977, 0.19635000000000002, 0.21995, 0.30325, 0.22565]
  </code></pre>
  
  <p>And X is:</p>
  
  <pre><code>[0.91157701638785, 0.586013796249332, 0.820419314749065, 0.937622073998931, 1.17202759249866, 0.520901152221628, 0.872509429971228, 0.989712189221094, 1.0548248332488, 1.02877977563772, 0.807396785943524, 0.92459954519339, 1.30225288055407, 1.01575724683218, 0.859486901165687, 0.976689660415553, 1.00273471802663, 1.23714023652637, 0.455788508193925, 1.10691494847096, 0.846464372360146, 0.963667131610013, 1.09389241966542, 0.781351728332443, 0.898554487582309, 1.08086989085988, 0.716239084304739, 0.833441843554605, 0.950644602804472, 1.04180230444326, 1.1199374772765, 1.06784736205434, 0.651126440277035, 0.885531958776768]
  </code></pre>
  
  <p><code>type(X)</code> and <code>type(Y)</code> give: <code>&lt;type 'list'&gt;</code></p>
  
  <p>If I do a polynomial interpolation in excel it looks like the following:
  <a href="https://i.stack.imgur.com/6C2f1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6C2f1.png" alt="enter image description here"></a></p>
  
  <p>Any pointers on what is generating this error would be super helpful.</p>
  
  <p>Thank you!</p>