Writing array to csv python (one column)

前端 未结 5 928
一整个雨季
一整个雨季 2021-01-14 02:09

I\'m trying to write the values of an array to a .csv file in python. But when I open the file in excel, the data is shown in one row. I want to have one column where each m

5条回答
  •  感情败类
    2021-01-14 02:58

    You should change the delimiter. CSV is Comma Separated Value, but Excel understands that a comma is ";" (yeah weird). So you have to add the option delimiter=";", like

    csv.writer(myfile, delimiter=";")
    

提交回复
热议问题