np.interp

This method interpolate or determines the value of position for a given function.

Function here means two arrays data points of equal length. np.interp is then determines the corresponding value of given position with respect to the function (two arrays).

x = np.array([1, 2, 3, 4])
y = np.array([1, 2, 3, 4])
 
np.interp(0, x, y)
# 1.0
# obiuously 
 
# calculating 100 points between x min and max
x_interp = np.linspace(x.min(), x.max(), 100)
 
y_interp = np.interp(x_interp, x, y)
 
# y_interp will be values corresponding to x_interp value with respect to function x, y