with open(file1, 'r') as fin:
    with open(file2, 'w') as fout:
        fields = ['ID', 'transect', '90mdist']
reader = csv.DictReader(fin, fieldnames=fields)
writer = csv.DictWriter(fout, fieldnames=fields)
fout.write(','.join(fields) + '\n')
next(reader)
for record in reader:
    mess_with_record(record)
writer.writerow(record)
if __name__ == '__main__':
    twiddle_csv('file1', 'file2')
Как заменить столбец в файле CSV в Python?