Interpolate DataFrame columns

For example:

using DataFrames, Interpolations

df = sort(DataFrame(Y = rand(4), X = rand(4)), [:X])

intlin = LinearInterpolation(df[:,:X], df[:,:Y], extrapolation_bc=Line());
x = 0:0.02:1;
y = intlin(x)

df_int = DataFrame(Xint = x, Yint = y)

DataFrame_Interpolations

2 Likes