Group Code
1 2
1 2
1 4
1 1
2 4
2 1
2 2
2 3
2 1
2 1
2 3
Within each group there are pairs. In Group 1 for example; the pairs are (2,2),(2,4),(4,1)
I want to filter these pairs based on code numbers 2 AND 4 being present at either end(not both), both ends, and at the end of the pairs.
In group 1 for example, only (4,1) will be kept while (2,2) and (2,4) will be filtered out. Excepted Output:
Group Code
1 4
1 1
2 4
2 1
2 2
2 3