iterate over 2 rows offset by one pd df code example Example: pandas for loop after loc reset_index df.reset_index(inplace=True)