簡體   English   中英

有沒有辦法在 python 中將 append 數據寫入 excel 文件而不讀取其內容?

[英]Is there a way to append data to an excel file without reading its contents, in python?

我有一個巨大的主數據轉儲 excel 文件。 我必須定期向它發送 append 數據。 要附加的數據存儲為 pandas dataframe。 有沒有辦法把 append 這個數據放到主轉儲文件中,而不必讀取它的內容。

轉儲文件很大,程序加載文件需要相當長的時間(使用熊貓)。

我已經嘗試過 openpyxl 和 XlsxWriter 但它沒有用。

不可能只將 append 轉換為像文本文件這樣的 xlsx 文件。 An xlsx file is a collection of XML files in a Zip container so to append data you would need to unzip the file, read the XML data, add the new data, rewrite the XML file(s) and then rezip them.

這實際上是 OpenPyXL 所做的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM