如何将pandas-profiling报告集成到dash应用程序中?
Streamlit允许这些集成(但我很难在其中管理缓存/会话) https://discuss.streamlit.io/t/including-pandas-profiling-report-in-streamlit/473/2
但我在dash上没有看到任何关于这方面的文档。请帮帮忙。
发布于 2021-06-04 02:20:57
您有两个选项:
生成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-set 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的名字所说,不推荐使用它。
https://stackoverflow.com/questions/67182782
复制相似问题