Created
October 31, 2015 12:22
-
-
Save nrm176/c225f5567b06ba667a44 to your computer and use it in GitHub Desktop.
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 csv | |
files = [ | |
"a.csv", | |
"b.csv", | |
"c.csv", | |
"d.csv", | |
"e.csv" | |
] | |
BASE_PATH = "base_path/tobedecided" | |
codes = [] | |
for file in files: | |
filePath = '%s%s' % (BASE_PATH, file) | |
with open(filePath, 'r') as f: | |
reader = csv.reader(f) | |
header = next(reader) | |
for row in reader: | |
codes.append(row[1]) | |
d = {} | |
for code in codes: | |
if d.get(code): | |
d[code]+=1 | |
else: | |
d[code]=1 | |
for k,v in d.iteritems(): | |
if (v>1): | |
print k |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment