'interpolate value based on multiple columns in Python

I have this df:

d = pd.DataFrame({'A': [1,5,10,15],
                'value': [2, 3, 4, 1]})

d

enter image description here

Now I want to linear interpolate the value of A=9

I have tried different variants of df.interpolate(method ='linear'), but cant figure out how to use the placement of column A to get the right interpolation.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source