I have converted the elements of a column in a set
set_genes = set(df['genes'].unique()]
And I also have a table (a tsv file) whose one column has values that match my set. I want to extract from this table the lines where values match.
Example
print(set_genes)
{'IDA'}
print(file)
1 1 10 IDA ID1
1 10 20 IDA ID2
1 20 30 IDA ID3
2 1 10 IDB ID1
2 20 20 IDB ID2
2 30 30 IDB ID3
Results
1 1 10 IDA ID1
1 10 20 IDA ID2
1 20 30 IDA ID3