Below is what I tried based on previous advice. Enumerate does not work with a writer (writer is not iterable). I am simply trying to open an existing CSV file and write into columns that are already present (or overwrite values that are in those columns). Below is the code I am using. Thank you!
ofile = open('PSL_Combined_Sorted.csv', 'w', newline='') writer = csv.writer(ofile) PO_ID = 1000000 PO_IDTrans_ID = 2000000 for row in enumerate(writer): writer.writerow({'Purchase Order Number' : PO_ID, 'Purchases Transaction ID Number' : PO_IDTrans_ID}) PO_IDTrans_ID = PO_IDTrans_ID + 1 PO_ID = PO_ID + 1