# Getting the intersect between two genotype dataset

**URL:** https://discuss.hail.is/t/getting-the-intersect-between-two-genotype-dataset/3685
**Category:** Hail Query & hailctl
**Created:** [December 12, 2023, 7:01pm UTC](https://discuss.hail.is/t/getting-the-intersect-between-two-genotype-dataset/3685 "2023-12-12T19:01:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![chuanfuyap](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@chuanfuyap](https://discuss.hail.is/u/chuanfuyap)
#### Post date: [December 12, 2023, 7:01pm UTC](https://discuss.hail.is/t/getting-the-intersect-between-two-genotype-dataset/3685/1 "2023-12-12T19:01:54Z")

</div>

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

```python
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]`
