title: How to apply cubic spline interpolation over long Pandas Series?
body: <p>I need to replace missing data within pandas Series using cubic spline interpolation. I figured out that I could use the <code>pandas.Series.interpolate(method='cubic')</code> method, which looks like this:</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  # create series
  size = 50
  x = np.linspace(-2, 5, size)
  y = pd.Series(np.sin(x))
  
  # deleting data segment
  y[10:30] = np.nan
  
  # interpolation
  y = y.interpolate(method='cubic')
  </code></pre>
  
  <p>Although this method works just fine for small series (<code>size = 50</code>), it seems to cause the program to freeze for larger ones (<code>size = 5000</code>). Is there a workaround?</p>