Skip to content
Advertisement

Python – Write array output in .csv file for each for loop iteration

I’m trying to write the output data of this for loop in a .csv file. However, what gets written in the .csv file with the current code is the data of a single iteration. I want to append and write the data in a new row for each iteration. How do I do that?

JavaScript

Advertisement

Answer

Try to append instead of write mode:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement