0

I have a data frame that read from excel column lie following, for exampmple.

items
1
2
3
4
5
6
7
8
9

I want to itarate with a for loop that a frame size 3

df = pandas.read_csv('data.csv')

for i in ?? 
   // iterarion1 calculate(9,8,7)
   // iterarion2 calculate(8,7,6)
   // iterarion2 calculate(7,6,5)

every iteration moving 3 items.

But I could not do this with python.

EoinS
  • 5,405
  • 1
  • 19
  • 32
barteloma
  • 6,403
  • 14
  • 79
  • 173
  • Does this answer your question? [Pandas iterating over multiple rows at once with overlap](https://stackoverflow.com/questions/56647535/pandas-iterating-over-multiple-rows-at-once-with-overlap) – the_strange Nov 09 '22 at 20:44

0 Answers0