首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在dash应用程序中集成pandas-profiling报告

在dash应用程序中集成pandas-profiling报告
EN

Stack Overflow用户
提问于 2021-04-21 00:26:28
回答 1查看 264关注 0票数 1

如何将pandas-profiling报告集成到dash应用程序中?

Pandas Profiling

Streamlit允许这些集成(但我很难在其中管理缓存/会话) https://discuss.streamlit.io/t/including-pandas-profiling-report-in-streamlit/473/2

但我在dash上没有看到任何关于这方面的文档。请帮帮忙。

EN

回答 1

Stack Overflow用户

发布于 2021-06-04 02:20:57

您有两个选项:

生成de html页面并将其作为资产加载到Dash中:

代码语言:javascript
复制
1 - Create the Report  
profile = ProfileReport(df, title="Pandas Profiling Report")
profile.to_file("your_report.html")

2 - Load the html report
https://github.com/plotly/dash-core-components/issues/429

获取原始文本并安装dash-dangerously set-set html以原始格式使用它:

代码语言:javascript
复制
1- Install the lib

pip install dash-dangerously-set-inner-html

2- Create the raw report

profile = ProfileReport(df, title="Pandas Profiling Report")
text_raw = profile.to_html()

3- Use it in your dash

app.layout = html.Div([
dash_dangerously_set_inner_html.DangerouslySetInnerHTML('''HTML CODE HERE''')])

app.layout = html.Div([
dash_dangerously_set_inner_html.DangerouslySetInnerHTML(text_raw)])

正如lib的名字所说,不推荐使用它。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67182782

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档