I have a pandas table of wind speed values ("WS") and I want to look up the corresponding power values in a lookup table ("PC"). If the exact value doesn't exist, then I want it to interpolate between the values in the lookup table. Is this simple and possible to do? I was able to accomplish this in excel so I feel like there should be a way to do this here in python.
Data in text:
print (WS)
0 6.869516
1 6.366496
2 5.863476
3 5.360457
4 5.073017
5 4.569997
6 3.995117
7 3.563957
8 3.204657
9 3.132797
dtype: float64
print (PC)
WS Power [kWh]
0 0.0 0
1 0.5 0
2 1.0 0
3 1.5 0
4 2.0 0
5 2.5 0
6 3.0 0
7 3.5 55
8 4.0 128
9 4.5 211
10 5.0 310
11 5.5 431
12 6.0 567
13 6.5 727
14 7.0 910
15 7.5 1119
16 8.0 1356
What is the best way and simplest way to accomplish this? For example, for WS[0] which is 6.869516, this value falls between 6.5 and 7 WS in the look up table this would give a power value between 727 and 910 kwh but probably closer to the 910 value. I would want the code to interpolate between the values and split out the interpolated power value for each WS in the "WS" pandas table.