how to get the number of columns that have the same value between 2 rows I want to compare two records and get the number of columns that have the same value , for example
I have two rows, the first row is :




rank
rank1
rank2




1
1
3




and the second row is




rank
rank1
rank2




1
1
2




the result should be 2 columns have the same value. is there a function in python that is capable of performing something like this?
If your records are in form of a pandas dataframe, then you can use df.columns.duplicated() to know the columns which are duplicated.