Skip to content

Instantly share code, notes, and snippets.

@ev-br
Last active November 8, 2022 15:48
Show Gist options
  • Save ev-br/fcd25570c3f332faefd521e6d3c87510 to your computer and use it in GitHub Desktop.
Save ev-br/fcd25570c3f332faefd521e6d3c87510 to your computer and use it in GitHub Desktop.
Recommended routines for interpolation in `scipy.interpolate`
kind routne continuity comment alias
linear numpy.interp broken line comes from numpy
cubic spline CubicSpline 2nd derivative
1D monotone cubic spline PchipInterpolator 1st derivative non-overshooting
non-cubic spline make_interp_spline (k-1)th derivative
nearest interp1d none kind='nearest',
'previous', 'next'
-----------------
N-D curve nearest, linear, spline make_interp_spline (k-1)th derivative use N-dim y array
-----------------
nearest
N-D regular grid linear RegularGridInterpolator rectilinear grids interpn
splines 2nd derivatives
monotone splines 1st derivatives method='pchip'
-----------------
nearest NearestNDInterpolator
N-D scattered linear LinearNDInterpolator griddata
cubic (2D only) CloughTocher2DInterpolator 1st derivatives
@ev-br
Copy link
Author

ev-br commented Nov 8, 2022

@tupui yes, great idea! In the scipy.interpolate tutorial, which is where the canonic version of this table resides now :-).

@tupui
Copy link

tupui commented Nov 8, 2022

ah yes cool. I missed/forgot that it went in.

@ev-br
Copy link
Author

ev-br commented Nov 8, 2022

Indeed, this was a wall of text PR, easy to miss parts of! BTW,the whole rbf section of the tutorial needs porting from rbf to rbfinterpolator. Would be even better if an rbf/rbfinterpolator user does it. Are you?

@tupui
Copy link

tupui commented Nov 8, 2022

Truth to be told at the moment I am really only a user of stats.qmc 😅 But agreed we should at least update the code to use RBFInterpolator. I can do that quickly if you want.

@ev-br
Copy link
Author

ev-br commented Nov 8, 2022

Would be great actually!

Re stats.qmc --- this is a great piece of work, much appreciated!

@tupui
Copy link

tupui commented Nov 8, 2022

Thanks 😃

And just opened scipy/scipy#17371

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment