df = pd.DataFrame({'a': [1, 2, 3, 4, 5, 6],
'b': [1, 1, 2, 3, 5, 8],
'c': [1, 4, 9, 16, 25, 36]})
df.diff()
# 计算某一列差值
df.c.diff(1)
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.diff.html