c2 = csv.reader(f2)
idlist = list(c2)
masterlist = list(c1)
for id in idlist[1:]:
    found = False
for master in masterlist[1:]:
    if id == master:
        found = True
if found:
    print('Found in master file')
else:
    print('Not found in master file')
f1.close()
f2.close()
Python - Searching .csv file with rows from a different .csv file