how to get the number of columns that have the same value between 2 rows
If your records are in form of a pandas dataframe, then you can use df.columns.duplicated() to know the columns which are duplicated.