I am trying to convert a column to a dataframe to get a new column, with each row in the new column being interpolated from the old column and the lookup table. Example:
Source data frame:
Date StartingValue
2010-01-01 10
2010-01-02 25
2010-01-03 15
2010-01-04 20
View frame information frame:
StartingValue NewValue
10 500
20 1200
30 2750
Desired Result:
Date StartingValue NewValue
2010-01-01 10 500
2010-01-02 25 1975
2010-01-03 15 850
2010-01-04 20 1200
The index will remain unchanged, and the interpolation should be linear between the nearest rows in the lookup table.
I looked maybe at map()
or apply()
, but I can't figure out how to use them here, especially with interpolation. All help is appreciated.
source
share