So I want to only show the rows in which the x and y value of the other id's matches the x and y of id 0. For example, show id 0 and id 250017920 (row 9) as the x and y match out of the first 20 rows. This process would need to be repeated for all rows so that all we have left is the rows where the x and y match that of id 0 as its x and y changes.
d={'ID':[0,2398794,3987694,987957, 9875987, 76438739, 2474654, 1983209, 2874050, 250017920, 38764902],
    'x':[-46,8769,432, 426, 132, 93, 124, 475, 857, -46, 67],
    'y':[2562,987, 987, 252, 234, 123, 765, 1452, 542, 2562, 5876],
    'z':[5, 7, 6, 2, 7, 7 ,4 , 5 , 1, 9,3]}
data=pd.DataFrame(data=d)
           ID     x     y  z
0           0   -46  2562  5
1     2398794  8769   987  7
2     3987694   432   987  6
3      987957   426   252  2
4     9875987   132   234  7
5    76438739    93   123  7
6     2474654   124   765  4
7     1983209   475  1452  5
8     2874050   857   542  1
9   250017920   -46  2562  9
10   38764902    67  5876  3
 
    