Say I have this dataframe:
df = pd.DataFrame([
('max', 'park', True),
('max', 'home', False),
('max', 'somewhere', True),
('spot', 'home', False),
('spot', 'park', False),
('bell', 'home', True),
('bell', 'park', True),
], columns='name,location,seen'.split(','))
df
How do I find everyone who has been seen in one place, but not another? An alternative way to phrase this question is how do I filter a MultiIndex series with more than one value in a given index.
df.groupby('name').seen.value_counts()
name seen
bell True 2
max True 2
False 1
spot False 2
Name: seen, dtype: int64
I want to filter to see just max in this case. E.g. I would like this:

