I have two sets of data points, set1
and set2
, each of which contains two columns of x
and y
values, like that (for one of them, the other has similar structure and values)
x y
0.015 0.01
0.025 0.015
.. ..
0.115 0.07
so that we have an x
axis that scales in steps of 0.01
, while y
is random. Then I have a third set, set3
, which looks this way
x y
0.025 0.2
0.075 0.1
... ...
3.475 0.005
so the increment is x
is again constant and in this case equal to 0.05
, while y
is again random. The range in x
of set3
is much wider than set1
and set2
.
My goal is to have three sets that span the same range in x.
To do so, I though about interpolating the two shorter sets, set1
and set2
, whose x ranges are contained in set3
's one.
I did it (for set1
for example, analogously for set2
), using
import scipy.interpolate as itp
spline_set1 = itp.splrep(xvalues_set1, yvalues_set1)
extended_set1 = itp.splev(xvalues_set3, spline_set1)
but a plot of extended_set1
looks as if this is not the way to go. The values are too high, many orders of magnitude bigger than they should be.
Any ideas?