Created
September 22, 2017 23:18
-
-
Save Hasil-Sharma/921320b07ca03fb94ab4c25f0c5d5fc4 to your computer and use it in GitHub Desktop.
Finding records which are in one DataFrame (df1) and not in other DataFrame (df2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
df1['marker'] = 1 | |
joined = pd.merge(df1, df2, on = ['column'], how = 'left') | |
# Required columns are the ones with marker as NaN | |
df1 = joined[pd.isnull(joined['marker'])][df1.columns] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment