-3
我需要添加幾個df
到一個excel,我希望它們看起來像 。 是pandas
中的任何函數。那可以做到嗎?熊貓:添加幾個數據幀到一個Excel文件
我需要添加幾個df
到一個excel,我希望它們看起來像 。 是pandas
中的任何函數。那可以做到嗎?熊貓:添加幾個數據幀到一個Excel文件
有關佈局,請參閱to_excel
文檔。 請注意,您必須將它傳遞給pd.ExcelWriter
對象而不是路徑字符串,然後調用它的save
方法以便能夠將多個數據框保存到同一個excel文件(相同或不同的工作表)。
對於設計本身,這將需要一些擺弄openpyxl
。
您可以試試我編寫的一個庫,名爲StyleFrame
(記錄在github和readthedocs),並查看它是否滿足您的需求。
看看[這個](http://stackoverflow.com/questions/34945456/is-it-possible-to-insert-a-worksheet-into-an-existing-workbook-using-python)和還有[this](http://stackoverflow.com/questions/35604888/how-to-persist-excel-references-in-formulas-across-worksheets-where-the-workshee) – toasteez
和[this](http: /stackoverflow.com/questions/37320355/using-named-ranges-in-excel-with-a-selection-of-cells)我不得不創建一個帶有命名範圍的模板,然後添加一些數據來顯示。 – toasteez