Adding a column thats result of difference in consecutive rows in pandas April 27, 2023 by Tarik Use shift. df['dA'] = df['A'] - df['A'].shift(-1)