python - 在 Flask 应用程序中的视图 (html) 上显示 pyfolio 输出
问题描述
我想将 pyfoliopf.create_full_tear_sheet()
输出显示到我的 Flask html 视图中,类似于jupyter/notebook所做的。
我可以pf.create_returns_tear_sheet(...,return_fig=True)
用来保存图像并在视图中显示该图像,如下所示:
f = pf.create_returns_tear_sheet(returns=returns, positions=positions, transactions=tran,benchmark_rets=benchmark_returns,return_fig=True);
f.savefig('returns.png')
如何为create_full_tear_sheet()方法实现相同的效果?
解决方案
推荐阅读
- node.js - 在 ubuntu 中的 apache 服务器 (vps) 上运行节点项目
- c - 在 HTTP 站点开始挂起之前 C 套接字未接收到所有数据
- python - 为什么我的 Flask 应用程序在使用内存中的新文件部署时返回 500 服务器错误?
- c# - 找不到方法:'System.String System.String.Format(System.IFormatProvider, System.String, System.Object)'
- javascript - 如何在反应导航中处理两个导航器?
- java - 如何将 MaryTTS 语音(Jar 文件)添加到我自己的 jar/从 IntelliJ 中的文件夹中加载
- c++ - “点段”距离:这段代码不应该使用范数而不是范数平方吗?
- sql - 优化 GUID 列
- c++ - CMake ExternalProject 依赖冲突
- node.js - 作业失败后如何获得额外的调试(facebook-nodejs-business-sdk)