I have defined the following linear interpolator:
julia> using DataFrames, Interpolations
julia> xs = 1:0.2:5;
julia> ys = log.(xs);
julia> li = LinearInterpolation(xs, ys);
and have a data frame:
julia> df = DataFrame(x=2:0.1:3)
11×1 DataFrame
Row │ x
│ Float64
─────┼─────────
1 │ 2.0
2 │ 2.1
3 │ 2.2
4 │ 2.3
5 │ 2.4
6 │ 2.5
7 │ 2.6
8 │ 2.7
9 │ 2.8
10 │ 2.9
11 │ 3.0
I can pass the :x column of a data frame to li like this:
julia> li(df.x)
11-element Vector{Float64}:
0.6931471805599453
0.7408022704621078
0.7884573603642704
0.831963048859085
0.8754687373538997
0.915490091190668
0.9555114450274363
0.9925654311042973
1.0296194171811581
1.0641158529246337
1.0986122886681098
However, when I try using the transform function it fails:
julia> transform(df, :x => li => :y)
ERROR: ArgumentError: Unrecognized column selector: :x => (21-element extrapolate(scale(interpolate(::Vector{Float64}, BSpline(Linear())), (1.0:0.2:5.0,)), Throw()) with element type Float64:
and throws a strange error that I do not understand. How to resolve this issue?