我有一个这样的数据框
df = pd.DataFrame({'patient': ['patient1', 'patient1', 'patient1','patient2', 'patient2', 'patient3','patient3','patient4'],
'gene':['TYR','TYR','TYR','TYR','TYR','TYR','TYR','TYR'],
'variant': ['buu', 'luu', 'stm','lol', 'bla', 'buu', 'lol','buu'],
'genotype': ['hom', 'het', 'hom','het', 'hom', 'het', 'het','het']})
df
patient gene variant genotype
0 patient1 TYR buu hom
1 patient1 TYR luu het
2 patient1 TYR stm hom
3 patient2 TYR lol het
4 patient2 TYR bla hom
5 patient3 TYR buu het
6 patient3 TYR lol het
7 patient4 TYR buu het
我想确定哪些患者有BUU和其他变种,但没有LUU.因此,预期的输出应该是这样的
patient gene variant genotype
patient3 TYR buu het
patient3 TYR lol het
我怎么能这样做呢?