【发布时间】:2013-11-12 15:33:09
【问题描述】:
听起来有些奇怪,但我需要将 Pandas 控制台输出字符串保存为 png pics。例如:
>>> df
sales net_pft ROE ROIC
STK_ID RPT_Date
600809 20120331 22.1401 4.9253 0.1651 0.6656
20120630 38.1565 7.8684 0.2567 1.0385
20120930 52.5098 12.4338 0.3587 1.2867
20121231 64.7876 13.2731 0.3736 1.2205
20130331 27.9517 7.5182 0.1745 0.3723
20130630 40.6460 9.8572 0.2560 0.4290
20130930 53.0501 11.8605 0.2927 0.4369
有没有像df.output_as_png(filename='df_data.png')这样的方法来生成一个只显示上面内容的图片文件?
【问题讨论】:
-
看这个答案的第二部分:stackoverflow.com/a/10195347/1755432 目前没有像
df.plot(how='table')这样简单的方法。 -
@bigbug,你能把答案贴出来并标记为已解决吗?
-
这可能是同一个问题,但我有点不清楚stackoverflow.com/questions/24574976/…
-
看到这个问题stackoverflow.com/q/35634238/1321452,但不是公认的答案,而是其他一些,特别是stackoverflow.com/a/63387275/1321452
标签: python matplotlib pandas