I want to create a new df that given a starting value x0 and an end value x1 the output interpolates/extrapolates for a given n number of points.
For example, given the df below, I want to create a new df between x0=57000 and x1=62000 in steps of 250, or n=21 points:
x = [57136,57688,58046,58480,58730,59210,59775,60275,60900,61365,62030]
y = [3.87, 3.55, 3.75, 2.04, 2.66, 3.1, 3.38, 4.13, 3.7, 4, 5.78]
df = pd.DataFrame(data=[x,y]).transpose()
df.columns=['x','y']
Given df1, I want to create a new df2 such that the output will be:
>>>print(df2)
x y
0 57000 2.78745
1 57250 2.74425
2 57500 2.70106
3 57750 2.72185
4 58000 2.93666
5 58250 2.34479
6 58500 1.67233
7 58750 2.13959
8 59000 2.31422
9 59250 2.47805
10 59500 2.58523
11 59750 2.69242
12 60000 2.97746
13 60250 3.28227
14 60500 3.18627
15 60750 3.04574
16 61000 3.04658
17 61250 3.25947
18 61500 3.62019
19 61750 4.10685
20 62000 4.59351