Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -89,12 +89,19 @@ def main():
|
|
| 89 |
# 如果沒有可用的預期欄位,則使用所有數值欄位
|
| 90 |
if not available_columns:
|
| 91 |
available_columns = numeric_columns
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
if selected_columns:
|
| 100 |
# 準備雷達圖數據
|
|
|
|
| 89 |
# 如果沒有可用的預期欄位,則使用所有數值欄位
|
| 90 |
if not available_columns:
|
| 91 |
available_columns = numeric_columns
|
| 92 |
+
|
| 93 |
+
# 使用核取方塊選擇欄位
|
| 94 |
+
st.write("### 選擇要比較的欄位")
|
| 95 |
|
| 96 |
+
# 建立一個網格來排列核取方塊
|
| 97 |
+
cols = st.columns(3) # 每行3個核取方塊
|
| 98 |
+
|
| 99 |
+
selected_columns = []
|
| 100 |
+
for i, col in enumerate(numeric_columns):
|
| 101 |
+
# 預設勾選在可用欄位中的項目
|
| 102 |
+
checkbox_col = cols[i % 3]
|
| 103 |
+
if checkbox_col.checkbox(col, default=col in available_columns):
|
| 104 |
+
selected_columns.append(col)
|
| 105 |
|
| 106 |
if selected_columns:
|
| 107 |
# 準備雷達圖數據
|