I\'ve got a dataframe with the following information:
filename val1 val2 t 1 file1.csv 5 10 2 file1.csv NaN Na
>>> df.groupby('filename').apply(lambda group: group.interpolate(method='index')) filename val1 val2 t 1 file1.csv 5 10 2 file1.csv 10 15 3 file1.csv 15 20 6 file2.csv NaN NaN 7 file2.csv 10 20 8 file2.csv 12 15