If you want to get the difference between rows of a pandas DataFrame, use df.diff().
Adjust the periods argument to shift more than one period for calculating the difference.
If you want to get the difference between rows of a pandas DataFrame, use df.diff().
Adjust the periods argument to shift more than one period for calculating the difference.