自动化报告pptx-python|如何将pandas的表格写入PPTX(二)

本篇延续:自动化报告的前奏|使用python-pptx操作PPT(一)
因为在pptx-python中使用table,需要单个cell逐一输入,于是在想有没有pandas可以直接读入的方式,
有两个开源项目有类似的功能:

  • PandasToPowerpoint
  • mspandas

其中mspandas写的比较复杂,PandasToPowerpoint比较易懂,就以此为本篇主要的研究对象。

1 案例1

核心代码:pd2ppt.py

在函数df_to_table中可以看到:

def df_to_table(slide, df, left=None, top=None, width=None, height=None,
                colnames=None, col_formatters=None, rounding=None,
                name=None, table_style=None):
    left = process_position_pa

你可能感兴趣的:(付费-智能写作专栏,LLM大模型,Python︱基础与数据处理,自动化,python,pandas,pptx-python)