I am working with pandas, but I don\'t have so much experience. I have the following DataFrame:
A 0 NaN 1 0.00 2 0.00 3 3.33 4
you might have to do it the hard way
B = [] i =0 m_lim = 11 while i=m_lim and i < len(A) -m_lim: B.append(sum(A[i-m_lim:i])) if i>= len(A) -m_lim: B.append(sum(A[i:])) i=i+1 df['B'] = B