I have a DataFrame sorted on one column (X):
df = sort(DataFrame(Y = rand(4), X = rand(4)), [:X])
4×2 DataFrame
Row │ Y X
│ Float64 Float64
─────┼────────────────────
1 │ 0.211423 0.491155
2 │ 0.839856 0.506252
3 │ 0.344844 0.731106
4 │ 0.196441 0.963763
I would like to create a new DataFrame whose X points are evenly distributed across [0,1] that interpolate Y.
Something like that:
4×2 DataFrame
Row │ Y X
│ Float64 Float64
───────┼────────────────────
1 │ ... 0
2 │ ... 0.01
....................................
N-1 │ ... 0.99
N │ ... 1
I’ve tried using interpolation and extrapolations without success.