jack06215

[pandas] Remove exception data from another dataframe

Sep 26th, 2020 (edited)
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import pandas as pd
  2.  
  3.  
  4. EXCLUDE = pd.DataFrame({'email':['[email protected]','[email protected]']})
  5.  
  6. df_result = pd.merge(USERS, EXCLUDE, how='outer', indicator=True)
  7. df_result[df_result._merge == 'left_only'].drop(labels=['_merge'], axis=1)
  8.  
Add Comment
Please, Sign In to add comment