0
df = pd.DataFrame([1,5,3, 2,1,2, 5,1,4, 8,6,7, 1,6,3])

I'd like to create a dataframe with the sum of every three successive elements in df

9
5
10
21
10

Is there an easy way to do this in pandas?

HappyPy
  • 9,839
  • 13
  • 46
  • 68

0 Answers0