小编sam*_*m c的帖子

Plotly Dash 表回调

我试图让滑块、用户输入和表格之间的依赖关系工作。我尝试输出数据并使用回调来更新它。我被建议只在回调中创建表并使用“Div”。来定义它在显示中的位置。

其他信息:

  • 表是使用 dash_table 库从 Pandas DataFrame 创建的。
  • 数据采用字典格式。
  • 变量threshold是由用户输入(滑块或输入)调整的值

如果有人能帮我找出表格不显示的原因,我将不胜感激?

这是我的代码:


import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
from dash.dependencies import Input, Output
import dash_table

threshold = 0.5
################################################################
###################### Table Data ##############################
################################################################

metrics_index = ["AUC", "Accuracy", "Kappa", "Sensitivity (Recall)", "Specificity", "Precision", "F1"]

algo_columns = ["Test-SVM+Naïve B", "RF"]

table_data = {"AUC": [threshold * 0.8, threshold * 0.83],
              "Accuracy": [threshold * 0.85, threshold * 0.86],
              "Kappa": …
Run Code Online (Sandbox Code Playgroud)

python callback plotly-dash

5
推荐指数
1
解决办法
5684
查看次数

标签 统计

callback ×1

plotly-dash ×1

python ×1