Irit Katriel <iritkatr...@gmail.com> added the comment:
It's not hard to write a helper function that checks whether a csv has duplicated columns: def unique_cols(filename): cols = next(csv.reader(open(filename,'r'))) return len(cols) == len(set(cols)) >>> with open('x.csv', 'w') as f: ... f.write('foo,bar,foo\n1,2,3\n') ... >>> with open('y.csv', 'w') as f: ... f.write('foo,bar,baz\n1,2,3\n') ... >>> unique_cols('x.csv') False >>> unique_cols('y.csv') True ---------- nosy: +iritkatriel _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue17537> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com