【问题标题】:Error exporting styled dataframes to image将样式化数据帧导出到图像时出错
【发布时间】:2023-01-17 06:59:10
【问题描述】:

我使用 dataframe_image 有一段时间了,到目前为止效果很好。上周,突然之间,我所有包含方法 dfi.export() 的代码都停止工作,并将此错误作为输出

` raise SyntaxError("不是 PNG 文件")

文件 语法错误:不是 PNG 文件`

我可以导出传递参数 table_conversion='matplotlib' 的图像,但它们没有样式化...

这是我的代码:

now = str(datetime.now())
filename = ("Extracciones-"+now[0:10]+".png")

df_styled = DATAFINAL.reset_index(drop=True).style.apply(highlight_rows, axis=1)

dfi.export(df_styled, filename,max_rows=-1)

IMAGEN = Image.open(filename)
IMAGEN.show()

关于为什么这突然停止工作的任何线索?或将数据框导出为图像(不使用 html)的任何想法? 先感谢您

这些是我以前得到的输出: fully styled dataframe images

这是我现在唯一能得到的:

enter image description here

【问题讨论】:

    标签: python pandas dataframe image


    【解决方案1】:

    我遇到了同样的问题,我们终于弄明白了;看起来 1/14 的新版本 dataframe_image 打破了以前版本的某些东西。 我们升级了软件包,问题得到解决。 ‘’’ pip install -u dataframe_image ‘’’

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-15
      • 1970-01-01
      • 2017-12-01
      • 2018-01-21
      • 1970-01-01
      • 2023-01-20
      • 1970-01-01
      • 2012-06-14
      相关资源
      最近更新 更多