Question: I have a df as follows:

```
foo bar baz
aaa 0   Laos
aaa 45  Nigeria
aaa 123 Panama
bbb 12  Panama
bbb 826 Nigeria
ccc 0   Laos
ccc 15  Laos
ccc 72  Panama
ddd 4   Panama
ddd 9   Laos
ddd 987 Panama
ddd 25  Nigeria

```

I also have a set: {"laos", "panama", "nigeria"}

I would like to groupby("foo") and only retain the groups for which column "baz" contains **all** values in the set.

So, the resulting df would contain only those lines (since bbb lacks Laos and ccc lacks Nigeria):

```
foo bar baz
aaa 0   Laos
aaa 45  Nigeria
aaa 123 Panama
ddd 4   Panama
ddd 9   Laos
ddd 987 Panama
ddd 25  Nigeria

```

Answer: 
Try with

```
s=df.groupby('foo').\
      filter(lambda x : pd.Series(["laos", "panama", "nigeria"]).isin(x['baz'].str.lower()).all())
Out[21]: 
    foo  bar      baz
0   aaa    0     Laos
1   aaa   45  Nigeria
2   aaa  123   Panama
8   ddd    4   Panama
9   ddd    9     Laos
10  ddd  987   Panama
11  ddd   25  Nigeria

```
```
df1 = df[df.groupby('foo')['baz'].transform('nunique').eq(3)]

```