[SciPy-User] faster interpolations (interp1d)

eat e.antero.tammi at gmail.com
Thu Feb 17 03:31:28 EST 2011


Hi,

On Thu, Feb 17, 2011 at 6:54 AM, James McCormac <jmccormac01 at qub.ac.uk>wrote:

> Hi Guys,
> Is there a faster way to do 1d interpolations in scipy. I am using
> interp1d "quadratic" which is already a fair bit quicker than the cubic
> interpolation. On small arrays <300 elements its fast enough but when I go
> beyond 500+ it stars to become more noticeable.
>
> I need to use at least a quadratic type interpolation and was wondering if
> there are any tricks.
>
Not a real trick, buy you can use vandermonde matrix, along the line
- solve b from dot(vander(x, 3), b)= y
- interpolate with any x_new, y_new= dot(vander(x_new), b)

In my machine within the range 5e2 to 2e3, it's roughly 4x faster than
interp1d.


My two cents,
eat

>
> Cheers
> James
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20110217/9be0f4c7/attachment.html>


More information about the SciPy-User mailing list