<p dir="auto">There seems to be a genuine bug in <code class="notranslate">scipy.interpolate.interp2d</code>. In this example the input arrays are given as full coordinates (and not as a regular grid). This data here, is part of a much bigger non-regularly sampled surface, thus I can't call <code class="notranslate">interp2d</code> with x, y as column and raw coordinates on a regular grid.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt;  data
array([(0.11, 1.0, 10.045999999999999), (0.13, 1.0, 9.6010000000000009),
       (0.14999999999999999, 1.0, 9.2579999999999991),
       (0.17499999999999999, 1.0, 8.9199999999999999),
       (0.20000000000000001, 1.0, 8.6479999999999997),
       (0.25, 1.0, 8.2159999999999993), (0.11, 2.0, 10.045999999999999),
       (0.13, 2.0, 9.5999999999999996),
       (0.14999999999999999, 2.0, 9.2579999999999991),
       (0.17499999999999999, 2.0, 8.9190000000000005),
       (0.20000000000000001, 2.0, 8.6460000000000008),
       (0.25, 2.0, 8.2089999999999996)], 
      dtype=[('M', '&lt;f8'), ('age', '&lt;f8'), ('J', '&lt;f8')])
&gt;&gt;&gt; interp_data = interp2d(data['M'], data['age'], data['J'])
Warning:     No more knots can be added because the number of B-spline coefficients
    already exceeds the number of data points m. Probably causes: either
    s or m too small. (fp&gt;s)
        kx,ky=1,1 nx,ny=7,5 m=12 fp=0.000284 s=0.000000"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt;  data
array([(0.11, 1.0, 10.045999999999999), (0.13, 1.0, 9.6010000000000009),
       (0.14999999999999999, 1.0, 9.2579999999999991),
       (0.17499999999999999, 1.0, 8.9199999999999999),
       (0.20000000000000001, 1.0, 8.6479999999999997),
       (0.25, 1.0, 8.2159999999999993), (0.11, 2.0, 10.045999999999999),
       (0.13, 2.0, 9.5999999999999996),
       (0.14999999999999999, 2.0, 9.2579999999999991),
       (0.17499999999999999, 2.0, 8.9190000000000005),
       (0.20000000000000001, 2.0, 8.6460000000000008),
       (0.25, 2.0, 8.2089999999999996)], 
      dtype=[('M', '&lt;f8'), ('age', '&lt;f8'), ('J', '&lt;f8')])
&gt;&gt;&gt; interp_data = interp2d(data['M'], data['age'], data['J'])
Warning:     No more knots can be added because the number of B-spline coefficients
    already exceeds the number of data points m. Probably causes: either
    s or m too small. (fp&gt;s)
        kx,ky=1,1 nx,ny=7,5 m=12 fp=0.000284 s=0.000000
</code></pre></div>
<p dir="auto">The result definitely doesn't look right, I don't expect any interpolated value to be around 0 especially with linear interpolation.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6788290/5002954/033c3ee2-69ff-11e4-9b9a-a68d3e19b2b4.png"><img src="https://cloud.githubusercontent.com/assets/6788290/5002954/033c3ee2-69ff-11e4-9b9a-a68d3e19b2b4.png" alt="failed_interp2d" style="max-width: 100%;"></a></p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/1642" rel="nofollow">http://projects.scipy.org/scipy/ticket/1642</a> on 2012-04-14 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rgommers/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rgommers">@rgommers</a>, assigned to unknown.</em></p>
<p dir="auto">This warning was showing up by default for a long time. The cause seems to be that the optional nxest/nyest parameters to surfit, which are determined in fitpack.pyf, are too small if kx=ky=1.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    &gt;&gt;&gt; x = [1,1,1,2,2,2,4,4,4]
    &gt;&gt;&gt; y = [1,2,3,1,2,3,1,2,3]
    &gt;&gt;&gt; z = array([0,7,8,3,4,7,1,3,4])
    &gt;&gt;&gt; lut = SmoothBivariateSpline(x, y, z, kx=1, ky=1, s=0)
/Users/rgommers/Code/scipy/scipy/interpolate/fitpack2.py:613: UserWarning: 
The required storage space exceeds the available storage space: nxest
or nyest too small, or s too small.
The weighted least-squares spline corresponds to the current set of
knots.
  warnings.warn(message)"><pre class="notranslate"><code class="notranslate">    &gt;&gt;&gt; x = [1,1,1,2,2,2,4,4,4]
    &gt;&gt;&gt; y = [1,2,3,1,2,3,1,2,3]
    &gt;&gt;&gt; z = array([0,7,8,3,4,7,1,3,4])
    &gt;&gt;&gt; lut = SmoothBivariateSpline(x, y, z, kx=1, ky=1, s=0)
/Users/rgommers/Code/scipy/scipy/interpolate/fitpack2.py:613: UserWarning: 
The required storage space exceeds the available storage space: nxest
or nyest too small, or s too small.
The weighted least-squares spline corresponds to the current set of
knots.
  warnings.warn(message)
</code></pre></div>
<p dir="auto">This needs some investigation. I'll filter out the warning for now.</p>
<p dir="auto">A likely related problem:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [3]: %paste
        x = [1,1,1,2,2,2,3,3,3]
        y = [1,2,3,1,2,3,1,2,3]
        z = [0,7,8,3,4,7,1,3,4]
        s = 0.1
        tx = [1+s,3-s]
        ty = [1+s,3-s]
        lut = LSQBivariateSpline(x,y,z,tx,ty,kx=1,ky=1)
## -- End pasted text --
/Users/rgommers/Code/scipy/scipy/interpolate/fitpack2.py:684: UserWarning: 
The coefficients of the spline returned have been computed as the
minimal norm least-squares solution of a (numerically) rank deficient
system (deficiency=7). If deficiency is large, the results may be
inaccurate. Deficiency may strongly depend on the value of eps.
  warnings.warn(message)"><pre class="notranslate"><code class="notranslate">In [3]: %paste
        x = [1,1,1,2,2,2,3,3,3]
        y = [1,2,3,1,2,3,1,2,3]
        z = [0,7,8,3,4,7,1,3,4]
        s = 0.1
        tx = [1+s,3-s]
        ty = [1+s,3-s]
        lut = LSQBivariateSpline(x,y,z,tx,ty,kx=1,ky=1)
## -- End pasted text --
/Users/rgommers/Code/scipy/scipy/interpolate/fitpack2.py:684: UserWarning: 
The coefficients of the spline returned have been computed as the
minimal norm least-squares solution of a (numerically) rank deficient
system (deficiency=7). If deficiency is large, the results may be
inaccurate. Deficiency may strongly depend on the value of eps.
  warnings.warn(message)
</code></pre></div>