# Set up a regular grid of interpolation points If you have millions of points, this implementation will be inefficient, but as a starting point: import numpy as np a "thin-plate-spline" is a particular type of radial basis function) is often a good choice. There's no one way to do this, and the "best" method depends entirely on the a-priori information you should be incorporating into the interpolation.īefore I go into a rant on "black-box" interpolation methods, though, a radial basis function (e.g. Now if x had N unique values, y had M unique values, then zvals will be a (N,M) 2d-array which can be fed to plt.contour.Īppendix: Example data import numpy as np.Since the values of pandas dataframe columns are just numpy arrays, you can call the reshape() method to create the needed 2d-array. This is kind of the inverse of "meshgrid" operation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |