I have a dataframe that has repeated values in one column (col_a) and repeated values in another column (col_b).
I want to select only the rows that have the same value in one column (col_a) but different values in another column (col_b).
Original dataframe
col_a col_b col_c
0 1 2 1
1 1 2 1
2 3 20 1
3 3 18 1
4 3 20 1
5 3 18 1
Desired dataframe
col_a col_b col_c
2 3 20 1
3 3 18 1
4 3 20 1
5 3 18 1
I've tried using df.duplicate but it doesn't work because I have duplicate values in both columns. I want to select only the rows that have different values in column b but equal values in column a.