Getting the intersect between two genotype dataset

Hi All, I am struggling with getting the intersect of of variants between two genotype dataset that I have converted to matrix table.

I tried following tutorial and cheatsheet. Unfortunately I keep getting error after error.

Is there anything that is equivalent just doing

intersect_variants=set(variant_genotype1) & set(variant_genotype2) `

then running an indexing function on one of the matrix table? Like if it was pandas, it would be genotype.loc[intersect_variants]