我正在努力从csv文件中提取数据组。我相信我需要if循环来迭代包含值的每一行,并忽略没有值的行。我怎样才能做到这一点? CSV文件摘录如下:
Closing Balances
Business Day Outlet Product Currency Amount
Customer Sales and Purchases
Business Day Outlet Product Currency Amount
Stock Additions and Returns
Business Day Outlet Product Currency Amount
Seller: WERF
Date: 01/01/2019
Closing Balances
Business Day Outlet Product Currency Amount
01/01/2019 9526 FX AUD 960
01/01/2019 9526 FX BGN 395
01/01/2019 9526 FX CZK 7354
01/01/2019 9526 FX ISK 4000
01/01/2019 9526 FX PLN 1130
Customer Sales and Purchases
Business Day Outlet Product Currency Amount
Stock Additions and Returns
Business Day Outlet Product Currency Amount
Seller: WAST
Date: 01/01/2019
Closing Balances
Business Day Outlet Product Currency Amount
01/01/2019 2 FX AED 2150
01/01/2019 2 FX EUR 9664
01/01/2019 2 FX HUF 54000
01/01/2019 2 FX ISK 89500
我希望python读取包含“结算余额”的组,并将列名称['Business Day',....]用作熊猫数据框的列,并忽略其他没有数据值的标题。最后,我想将两个数据框合并并保存。我有成千上万的csv文件代表相同格式的不同日期,我打算将它们加入使用这些数据框来绘制时间序列。 非常感谢您的见解。