How can I iterate over pairs of rows of a Pandas DataFrame?
For example:
content = [(1,2,[1,3]),(3,4,[2,4]),(5,6,[6,9]),(7,8,[9,10])] df = pd.DataFra
To get the output you've shown use:
for row in df.index[:-1]: print 'row 1:' print df.iloc[row].squeeze() print 'row 2:' print df.iloc[row+1].squeeze() print