I have 2 dataframes :  

df1 is a list of mailboxes and email ids  

df2 shows a list of approved domains

I read both the dataframes from an excel sheet

```py
    xls = pd.ExcelFile(input_file_shared_mailbox)
    df = pd.read_excel(xls, sheet_name = sheet_name_shared_mailbox)

```

i want to only keep records in df1 where df1[Email\_Id] contains df2[approved\_domain]

```
    print(df1)  
        Mailbox Email_Id  
    0   mailbox1   abc@gmail.com  
    1   mailbox2   def@yahoo.com  
    2   mailbox3   ghi@msn.com  

    print(df2)  
        approved_domain  
    0   msn.com  
    1   gmail.com  

```

and i want df3 which basically shows 

```
    print (df3)  
        Mailbox Email_Id  
    0   mailbox1   abc@gmail.com  
    1   mailbox3   ghi@msn.com  

```

this is the code i have right now which i think is close but i can't figure out the exact problem in the syntax

```py
df3 = df1[df1['Email_Id'].apply(lambda x: [item for item in x if item in df2['Approved_Domains'].tolist()])]

```

But get this error 

`TypeError: unhashable type: 'list'`

i spent a lot of time researching the forum for a solution but could not find what i was looking for. appreciate all the help.