Ticket #610 (closed enhancement: fixed)
Let numpy.interp accept scalar values as first argument
| Reported by: | Elby | Owned by: | somebody |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.1.0 |
| Component: | numpy.lib | Version: | none |
| Keywords: | Cc: |
Description
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.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
