comparing previous row values in pandas dataframe,df['match'] = df['col1'].diff().eq(0)