【问题标题】:create nice tables in excel with Python使用 Python 在 excel 中创建漂亮的表格
【发布时间】:2018-12-10 14:47:19
【问题描述】:

所以我有这个脚本可以输出一个可以保存到笔记本的 pandas 数据帧。但是这些表格看起来并不专业,我想知道 pandas/excel 编写模块中是否有一种方法可以让我在列中添加列标题、图例、合并单元格、添加标题等。

这是我从 python 中得到的 pandas 数据框:

使用此脚本:

excel_df=pd.DataFrame(closeended_all_counts).T
excel_df.columns=all_columns

writer=pd.ExcelWriter('L:\OMIZ\March_2018.xlsx',engine='xlsxwriter')
excel_df.to_excel(writer,'Final Tables')

workbook = writer.book
worksheet = writer.sheets['Final Tables']
writer.save()

而我需要这个输出:

任何文档或模块都会很棒!

【问题讨论】:

    标签: excel python-3.x pandas


    【解决方案1】:

    既然您正在寻找文档,那么就到这里吧:

    https://xlsxwriter.readthedocs.io/example_tables.html?highlight=tables

    【讨论】:

      猜你喜欢
      • 2012-04-16
      • 2012-07-20
      • 1970-01-01
      • 2013-05-25
      • 1970-01-01
      • 2015-08-27
      • 1970-01-01
      • 2021-08-05
      • 2017-08-24
      相关资源
      最近更新 更多