Is it possible to compare values on the same dataframe and set a new column to count the repetitions with pandas?
From:
id | column1 | column2
0 | a | a
1 | b | b
2 | a | c
3 | c | c
4 | b | b
To:
id | column1 | column2 | count
0 | a | a | 1
1 | b | b | 2
2 | a | c | 0
3 | c | c | 1
4 | b | b | 2