[SciPy-user] interpolate.interp1d

Cory Davis cdavis at staffmail.ed.ac.uk
Mon Nov 15 09:37:14 EST 2004


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