1

如何将熊猫分析报告集成到仪表板应用程序中?

熊猫分析

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

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

4

1 回答 1

1

您有 2 个选项:

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

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-inner-html 以使用原始格式:

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 的名称所说,不建议使用它。

于 2021-06-03T18:20:56.907 回答