scipy.interpolate.interp1d
. The default option is linear interpolation but for sparsely separated data a cubic spline is often preferable. See the interp1d manual page for additional options and details. First, import the necessary python packages and data: