[SciPy-user] interpolate.interp1d - please ignore previous post

Cory Davis cdavis at staffmail.ed.ac.uk
Mon Nov 15 08:41:58 CST 2004


Oops sorry guys.

Inputs:
            x -- a 1d array of monotonically increasing real values.
                 x cannot include duplicate values. (otherwise f is
                 overspecified)


Cory.

On Mon, 2004-11-15 at 14:37, Cory Davis wrote:
> Hi all,
> 
> It seems that interpolate.interp1d requires that the x argument is
> ascending. It seems odd that this should be the case. Either there is a
> bug or the ascending requirement should be stated in the documentation. 
> Here is an example ...
> 
> >>> from scipy.interpolate import *
> >>> zinterp=interp1d(x=-arange(10),y=arange(10)*2)
> >>> zinterp(-2.2)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File
> "/eosmls/local/linux/lib/python/scipy/interpolate/interpolate.py", line
> 165, in __call__
>     out_of_bounds = self._check_bounds(x_new)
>   File
> "/eosmls/local/linux/lib/python/scipy/interpolate/interpolate.py", line
> 219, in _check_bounds
>     raise ValueError, " A value in x_new is below the"\
> ValueError:  A value in x_new is below the interpolation range.
> 
> Cheers,
> Cory.
-- 
))))))))))))))))))))))))))))))))))))))))))))
Cory Davis
Meteorology
School of GeoSciences
University of Edinburgh
King's Buildings
EDINBURGH EH9 3JZ

ph: +44(0)131 6505092
fax +44(0)131 6505780
cdavis at staffmail.ed.ac.uk
cory at met.ed.ac.uk
http://www.geos.ed.ac.uk/contacts/homes/cdavis
))))))))))))))))))))))))))))))))))))))))))))



More information about the SciPy-user mailing list