I have the following dataframe
id device
814 desktop
814 mobile
236 mobile
498 desktop
348 mobile
287 mobile
287 desktop
I want to query the id's where device is both mobile & desktop
df.loc[(df['device'] == 'mobile') & (df['device'] == 'desktop'), ['id','device']]
The output should be
id device
814 desktop
814 mobile
287 desktop
287 mobile
Instead I just get an empty dataframe
id device