I have a DataFrame, say a volatility surface with index as time and column as strike. How do I do two dimensional interpolation? I can reindex but how do i deal with NaN? I know we can fillna(method='pad') but it is not even linear interpolation. Is there a way we can plug in our own method to do interpolation?
I have a DataFrame, say a volatility surface with index as time and column
Share
You can use
DataFrame.interpolateto get a linear interpolation.For anything more complex, you need to roll-out your own function that will deal with a
Seriesobject and fillNaNvalues as you like and return anotherSeriesobject.