Skip to content

Instantly share code, notes, and snippets.

@lucasmelin
Created February 21, 2018 04:35
Show Gist options
  • Save lucasmelin/65fed8210032b9c29edc75ff94a1fc19 to your computer and use it in GitHub Desktop.
Save lucasmelin/65fed8210032b9c29edc75ff94a1fc19 to your computer and use it in GitHub Desktop.
Python script to extract unique rows from a csv
with open('input.csv','r') as in_file, open ('output.csv','w') as out_file:
seen = set()
for line in in_file:
if line in seen: continue
seen.add(line)
out_file.write(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment