temp = [] fields = [\'error%d\' % i for i in range(1,6)] for col in fields: temp.append(pd.rolling_sum(pd.pivot_table(error_count,