Suppose I have following DataFrame:
key id1 id2 id3 id4 id5
1 8 1 1 9 7
2 5 2 2 2 2
3 5 4 7 9 1
I would like to count the number of times the values of id1-5 match with my key value and safe it as new column.
This would be my desired result:
key id1 id2 id3 id4 id5 matches
1 8 1 1 1 7 3
2 5 2 2 2 2 4
3 5 4 7 9 1 0