Memory error issue when running scipy interpolation (interp1d)
<p>I have tried to run scipy 1d-interpolation (interp1d) with various interpolation methods. Data is an array with 525600 numbers. When I ran it with simpler methods such as 'linear', 'nearest' or 'zero', it worked fine, but when I used 'cubic' or 'quadratic', it resulted 'memory error as below:</p>

<pre><code>Traceback (most recent call last):
File "inter_comp.py", line 37, in &lt;module&gt;
interp = interp1d(indices[not_nan], B[not_nan], bounds_error=False,fill_value=0.,  kind = 'cubic')
File "/lustre/work/apps/anaconda/lib/python2.7/site-   packages/scipy/interpolate/interpolate.py", line 476, in __init__
self._spline = splmake(self.x, self._y, order=order)
File "/lustre/work/apps/anaconda/lib/python2.7/site-packages/scipy/interpolate/interpolate.py", line 2356, in splmake
B = _fitpack._bsplmat(order, xk)
MemoryError
</code></pre>

<p>My code is as below:</p>

<pre><code>filn1 = "/lustre/work/hwon/PAPER2/Data/BAO_NEW/1year_New/BAO010_2013_WS_N.txt"

B = np.genfromtxt(filn1,delimiter="",usecols=0,dtype=None)
not_nan = np.logical_not(np.isnan(B))
indices = np.arange(len(B))
interp = interp1d(indices[not_nan], B[not_nan], bounds_error=False, fill_value=0.,  kind = 'cubic')
p1 = interp(indices)
</code></pre>

<p>I am not sure whether is the problem of the computing platform which I used or of the way to handle the data or of the coding.</p>

<p>Would you please give me any idea to sort this problem out?</p>

<p>Thank you,
Isaac</p>