title: Why can I not interpolate even though the values are monotonically increasing?
body: <p>I have 2 arrays that I plot this way:</p>
  
  <pre><code>plt.plot(x1, x2)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ydaqA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ydaqA.png" alt="enter image description here"></a></p>
  
  <p>And I want to find out what are the values of <code>x2</code> at <code>x1=2,5,75,10,100, and 1000</code>. Since all values may not exist, I interpolate using this:</p>
  
  <pre><code>from scipy.interpolate import interp1d
  f1=interp1d(x1, x2)
  f2=interp1d(x1, x2, kind='cubic')
  </code></pre>
  
  <p>But <code>f2</code> throws this error:</p>
  
  <p><code>ValueError: Expect x to be a 1-D sorted array_like.</code></p>
  
  <p>But the values are monotonically increasingly as expected by: <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html" rel="nofollow noreferrer">https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html</a></p>
  
  <p>What am I doing wrong?</p>
  
  <p><code>x1</code></p>
  
  <pre><code>array([1.00020004e+00, 1.00020004e+00, 1.00080064e+00, 1.00200401e+00,
         1.00341160e+00, 1.00603622e+00, 1.01173614e+00, 1.02165917e+00,
         1.02965404e+00, 1.04362346e+00, 1.05820106e+00, 1.07688994e+00,
         1.10107906e+00, 1.12688754e+00, 1.16063138e+00, 1.19161106e+00,
         1.23578843e+00, 1.29198966e+00, 1.35062129e+00, 1.42775557e+00,
         1.52207002e+00, 1.63345312e+00, 1.77746178e+00, 1.93124759e+00,
         2.11954218e+00, 2.37191651e+00, 2.68528464e+00, 2.97973778e+00,
         3.38983051e+00, 3.89105058e+00, 4.48430493e+00, 5.31349628e+00,
         6.28930818e+00, 7.59878419e+00, 9.38086304e+00, 1.20192308e+01,
         1.57232704e+01, 2.06611570e+01, 2.68817204e+01, 3.49650350e+01,
         4.58715596e+01, 6.57894737e+01, 8.92857143e+01, 1.38888889e+02,
         2.27272727e+02, 4.16666667e+02, 1.00000000e+03, 2.50000000e+03,
         2.50000000e+03, 5.00000000e+03])
  </code></pre>
  
  <p><code>x2</code></p>
  
  <pre><code>array([ 11.18083778,  12.00065196,  12.88057749,  13.82502193,
          14.838716  ,  15.92673731,  17.09453577,  18.34796088,
          19.69329106,  21.13726508,  22.68711581,  24.35060647,
          26.1360695 ,  28.05244828,  30.10934199,  32.31705361,
          34.68664159,  37.22997521,  39.95979405,  42.88977178,
          46.0345847 ,  49.40998519,  53.03288065,  56.9214182 ,
          61.09507555,  65.57475857,  70.38290604,  75.54360201,
          81.08269642,  87.02793465,  93.40909644, 100.25814508,
         107.6093875 , 115.49964612, 123.96844331, 133.05819935,
         142.81444487, 153.28604899, 164.52546404, 176.58898835,
         189.53704818, 203.43450047, 218.35095766, 234.36113639,
         251.54523176, 269.98931903, 289.78578477, 311.03378962,
         333.83976499, 358.31794618])
  </code></pre>