Comparing previous row values in Pandas DataFrame,df['match'] = df['col1'].diff().eq(0)