df = pd.read_table('data', sep='\\s+')

def foo(x, df):
    window = df.iloc[x]
c = df.ix[int(x[-1]), 'c']
dvals = window['a'] + window['b'] * c
return bar(dvals)

def bar(dvals):
    return dvals.mean()
df['e'] = pd.rolling_apply(np.arange(len(df)), 6, foo, args=(df,))
print(df)
Роллинг функции на фрейме данных