I have a pandas data frame where I know the start value is the same for all columns and the end value is 90% and 80% of the 100% end value. I need to interpolate between the starting and end values and follow the trend of the 100% value (which is not linear). On a side note: I attempted a linear interpolation between the start and end but that wouldn't work, it returned the same exact dataframe, no NaNs were filled.
100% 90% 80%
Date
2017-01-01 6.000000 6 6
2017-02-01 6.000000 NaN NaN
2017-03-01 6.000000 NaN NaN
2017-04-01 6.000000 NaN NaN
... ... ...
2027-08-01 24.666667 NaN NaN
2027-09-01 24.666667 NaN NaN
2027-10-01 24.666667 NaN NaN
2027-11-01 24.666667 NaN NaN
2027-12-01 24.666667 22.2 19.7333
Solution: My problem was that the data types were objects instead of floats. After converting to floats and setting the 100% as the index I used the following to achieve the desired result:
df = df.interpolate(method='piecewise_polynomial')