Skip to content

Instantly share code, notes, and snippets.

@kaushil24
Created December 3, 2019 16:45
Show Gist options
  • Save kaushil24/abe4f0e019cb31f66e6714455126089b to your computer and use it in GitHub Desktop.
Save kaushil24/abe4f0e019cb31f66e6714455126089b to your computer and use it in GitHub Desktop.
from scipy.interpolate import interp1d
def interpolateCoordinates(xy_coords, x_intrp):
x = xy_coords[:, 0]
y = xy_coords[:, 1]
intrp = interp1d(x, y, kind='quadratic')
y_intrp = intrp(x_intrp)
y_intrp = np.floor(y_intrp).astype(int)
return y_intrp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment