how to combine delete rows based on condition on another dataframe

Solutions on MaxInterview for how to combine delete rows based on condition on another dataframe by the best coders in the world

showing results for - "how to combine delete rows based on condition on another dataframe"
Lennard
20 Jan 2019
1print (USERS.email.isin(EXCLUDE.email))
20     True
31    False
42    False
53    False
64     True
7Name: email, dtype: bool
8
9print (~USERS.email.isin(EXCLUDE.email))
100    False
111     True
122     True
133     True
144    False
15Name: email, dtype: bool
16
17print (USERS[~USERS.email.isin(EXCLUDE.email)])
18     email
191  b@g.com
202  b@g.com
213  c@g.com
Paloma
27 Nov 2016
1import pandas as pd
2
3USERS = pd.DataFrame({'email':['a@g.com','b@g.com','b@g.com','c@g.com','d@g.com']})
4print (USERS)
5     email
60  a@g.com
71  b@g.com
82  b@g.com
93  c@g.com
104  d@g.com
11
12EXCLUDE = pd.DataFrame({'email':['a@g.com','d@g.com']})
13print (EXCLUDE)
14     email
150  a@g.com
161  d@g.com