List = ['Mean', mean]List2 = ["Variance", variance]List3 = ["SD", std]rows = zip(List, List2, List3)from csv import writerwith open(r'E:\chrome dlds\null - Sheet1.csv', "a", newline = '') as f: writer = writer(f) for row in rows: writer.writerow(row)with open(r'E:\chrome dlds\null - Sheet1.csv', mode ='r') as file: csvFile = csv.reader(file) for lines in csvFile: print(lines)
I tried to add lists (List,List1,List2) into CSV file as a new row and expected output to read the lists as new rows.
I am new to CSV module so When using writer function, The output is adding List into last column of the CSV file. I want the list to append as a new row into csv file. Any suggestions?