I have a table of measured values for a quantity that depends on two parameters. So to speak, I have a function fuelConsumption(speed, temperature)for which grid data is known.
Now I want to interpolate the expected fuelConsumptionfor a large number of measured data points (speed, temperature) from pandas.DataFrame(and return a vector with values for each data point).
I am currently using SciPy interpolate.interp2dfor interpolation, but when passing parameters as two vectors [s1,s2]and [t1,t2](only for two ordered values for simplicity) it will build a grid and return:
[[f(s1,t1), f(s2,t1)], [f(s1,t2), f(s2,t2)]]
The result that I hope to get:
[f(s1,t1), f(s2, t2)]
How can I interpolate to get the result I want?
source
share