【发布时间】:2022-01-25 01:34:32
【问题描述】:
关注这个话题
Adding image to pandas DataFrame
我使用path_to_image_html 在我的 df pandas 数据框中显示一些 png(实际上是 matplotlib 中的图表)。
def toto():
df['imageUrls'] = images1
def path_to_image_html(path):
return '<img src="'+ path + '" width="60" >'
return HTML(df.to_html(escape=False,formatters=dict(imageUrls=path_to_image_html)))
然后display(toto()) 在我的 jupyter 笔记本中显示我的熊猫。
现在我想以 PNG 文件格式保存我的熊猫。 基本上将 toto() 转换为 png 文件。
我该如何继续?谢谢
【问题讨论】: