标签:http head overflow line file div stack csv 默认
默认在open(‘data.csv’,‘w+‘)模式下会有空行。在open后面添加newline=‘’ 即可解决。
https://stackoverflow.com/questions/41045510/pandas-read-csv-ignore-rows-after-a-blank-line
with open("data_a.csv","w",newline=‘‘) as csvfile: fieldnames = ["id","title"] writer=csv.DictWriter(csvfile,fieldnames=fieldnames) writer.writeheader() writer.writerow({"id":123,"title":"New title"}) writer.writerow({"id":345,"title":"test "})
标签:http head overflow line file div stack csv 默认
原文地址:http://www.cnblogs.com/uxiuxi/p/7439869.html