[SciPy-Dev] griddata problem in 0.9rc3

Pauli Virtanen pav at iki.fi
Sat Feb 19 09:38:09 EST 2011


On Sat, 19 Feb 2011 21:29:17 +0800, Wolfgang Kerzendorf wrote:
[clip]
> There is a problem with scipy.interpolate:
> 
> In [2]: interpolate.griddata([-1.5,-1.0], [5,6],[[-1.12]]) Out[2]:
> array([[ 5.76]])
> 
> In [3]: interpolate.griddata([-1.0,-1.5], [5,6],[[-1.12]]) Out[3]:
> array([[ nan]])
> 
> It depends on the order of the input values.

That's the behavior of interp1d, which griddata inherits. The x-values 
must be in ascending order.

>>> interp1d([-1.0, -1.5], [5, 6], bounds_error=False)([-1.12])
array([ nan])
>>> interp1d([-1.5, -1.0], [5, 6], bounds_error=False)([-1.12])
array([ 5.76])

Documentation issue, mainly.

-- 
Pauli Virtanen 




More information about the SciPy-Dev mailing list