According to these question Pandas iterate over DataFrame row pairs
I want to iterate over three rows like question above, but I find it difficult.
for (indx1,row1),(indx2,row2) in zip(df[:-1].iterrows(),df[1:].iterrows()):
print "row1:\n", row1
print "row2:\n", row2
print "\n"
These are the code in the solution for iterating two rows, and I want to modify these code so it could iterate three rows.
I am trying df.index//3
or df[::3]
but it's not what I want.
Help me