我試圖寫入空的CSV
文件。寫入CSV文件但格式不正確
我要上CSV文件的輸出是這樣的:
Date,Open,High,Low,Close,Volume,Adj Close
2014-03-28,538.32,538.94,534.25,536.86,7106900,536.86
2014-03-27,540.02,541.50,535.12,537.46,7929700,537.46
2014-03-26,546.52,549.00,538.86,539.78,10706000,539.78
2014-03-25,541.50,545.75,539.59,544.99,10081900,544.99
2014-03-24,538.42,540.50,535.06,539.19,12703600,539.19
2014-03-21,531.93,533.75,526.33,532.87,13373200,532.87
2014-03-20,529.89,532.67,527.35,528.70,7442800,528.70
2014-03-19,532.26,536.24,529.00,531.26,8027000,531.26
2014-03-18,525.90,531.97,525.20,531.40,7487400,531.40
2014-03-17,527.70,529.97,525.85,526.74,7126600,526.74
但我最終得到一個非常大的行數,每一個字符是不同的小區。
我的代碼是:
with open('prova.csv','w',newline='') as f:
writer = csv.writer(f,delimiter=',',quotechar='"')
writer.writerows(request3)
f.flush()
f.close()
和請求3的輸出是相同的表如上。
請與編程語言添加一個標籤。 –
它的Python,謝謝 – pkpkpk
不知道它...... GL –