我正在玩比特幣數據,並希望擺脫CSV文件中每行末尾的逗號。例如,CSV數據看起來是這樣的....如何使用Python在CSV中的每一行中刪除逗號?
Date Time,Open,High,Low,Close,Volume
2012-01-01 04:15:00,4.58,4.58,4.58,4.58,1.502,
2012-01-01 15:15:00,4.84,4.84,4.84,4.84,10.0,
2012-01-01 22:45:00,5.0,5.0,5.0,5.0,10.1,
2012-01-02 20:00:00,5.0,5.0,5.0,5.0,19.048,
2012-01-03 11:45:00,5.32,5.32,5.32,5.32,2.41917293,
2012-01-03 14:15:00,5.14,5.14,5.14,5.14,0.68,
而且我想使它看起來像這樣
Date Time,Open,High,Low,Close,Volume
2012-01-01 04:15:00,4.58,4.58,4.58,4.58,1.502
2012-01-01 15:15:00,4.84,4.84,4.84,4.84,10.0
2012-01-01 22:45:00,5.0,5.0,5.0,5.0,10.1
2012-01-02 20:00:00,5.0,5.0,5.0,5.0,19.048
2012-01-03 11:45:00,5.32,5.32,5.32,5.32,2.41917293
2012-01-03 14:15:00,5.14,5.14,5.14,5.14,0.68
我應該用熊貓或numpy的,以實現我想要什麼?如果是這樣,我該怎麼做?謝謝!
謝謝,作品像一個魅力! – BillyRay
這將在例子中從'Volume'中刪除'e' ... – dawg
是的,我不得不把它重新添加回 – BillyRay