[Numpy-tickets] [NumPy] #610: Let numpy.interp accept scalar values as first argument
NumPy
numpy-tickets@scipy....
Fri Nov 9 11:47:11 CST 2007
#610: Let numpy.interp accept scalar values as first argument
-------------------------+--------------------------------------------------
Reporter: Elby | Owner: somebody
Type: enhancement | Status: new
Priority: normal | Milestone: 1.0.5
Component: numpy.lib | Version: none
Severity: normal | Keywords:
-------------------------+--------------------------------------------------
The current version of numpy.interp does not accept a single value as
first argument, so it is not possible to make a single interpolation :
{{{
>>> import numpy as n
>>> n.__version__
'1.0.5.dev4420'
>>> xp = n.arange(10)
>>> yp = 2.5 + xp**2 -xp
>>> x = 3.2
>>> n.interp(x, xp, yp)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: object of too small depth for desired array
}}}
It would be a lot more nice to let x be a float, an int or another numpy
scalar object, as the attached patch does.
--
Ticket URL: <http://scipy.org/scipy/numpy/ticket/610>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list