I would like to bfill
and ffill
a multi-index DataFrame
containing NaN
s (in this case the ImpVol
field) usin
I'd try to unstack the data frame at the OptionType level of index.
df.unstack(level=1)
This way you should obtain a single index dataframe which will have both call and put categories moved to columns. Maybe it's not the most elegant way of solving the problem, but it should work things out, not letting the put/call strikes to overlap.
If multi index df is the most desirable one for further computations, you can restore the original format using stack method.