📅  最后修改于: 2022-03-11 14:48:31.735000             🧑  作者: Mango
df['match'] = df.col1.eq(df.col1.shift())
print (df)
col1 match
0 1 False
1 3 False
2 3 True
3 1 False
4 2 False
5 3 False
6 2 False
7 2 True