Created
June 11, 2014 16:53
-
-
Save wenhoujx/8869902f79494014ff45 to your computer and use it in GitHub Desktop.
remove from csv1 all csv2, and overwrite csv1.
This file contains 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 sys | |
import pandas as pd | |
if __name__ == "__main__": | |
""" | |
excluding from f1.csv all those names in f2.csv | |
and write back to f1 | |
""" | |
f1, f2 = sys.argv[1:] | |
df1 = pd.read_csv( f1) | |
df2 = pd.read_csv(f2) | |
df1 = df1[~df1.name.isin( df2) ] | |
df1.to_csv( f1, header=True, index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment