Quadratic Or Cubic 1d Interpolate Without Large Interpolator-building Overhead?
I'd like to quad or cube interpolate a long series of floats (or vectors) in 1d, where long could be 1E+05 or 1E+06 (or more). For some reason SciPi's handy interp1d()'s time overh
Solution 1:
For some reason SciPi's handy interp1d()'s time overhead to prepare the interpolators scales as almost n^3 for both quadratic and cubic splines.
According to this answer:
Short answer: update your scipy installation.
Longer answer: pre-0.19, interp1d was based on splmake which is using linear algebra with full matrices. In scipy 0.19, it was refactored to use banded linear algebra. As a result, (below is with scipy 0.19.1)
So the answer to your question:
Quadratic or cubic 1d interpolate without large interpolator-building overhead?
is still use scipy.interp1d
just not the old version of scipy that you were (in this case I was) using. Be sure to use scipy 0.19 or newer. Fyi version 1.0 has been released and so you (I) should update accordingly.
Post a Comment for "Quadratic Or Cubic 1d Interpolate Without Large Interpolator-building Overhead?"