pufanyi commited on
Commit
ed44f38
·
1 Parent(s): 229e191

Refactor GET_DEFAULT_CHECKBOX function to remove "Model Name" column and handle exceptions in app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -126,7 +126,7 @@ def init_leaderboard(dataframes):
126
  print("Search Term:", search_term)
127
  print("Selected Columns:", selected_columns)
128
  if isinstance(selected_columns, CheckboxGroup):
129
- print("Selected Columns:", selected_columns.choices)
130
  bak_selected_columns = copy.deepcopy(selected_columns)
131
  old_version = subset
132
  filtered_data = dataframes[subset]
@@ -135,7 +135,7 @@ def init_leaderboard(dataframes):
135
  filtered_data.sort_values(by="Total", ascending=False, inplace=True)
136
  # selected_columns.append("Model Name")
137
  if isinstance(selected_columns, CheckboxGroup):
138
- selected_columns = selected_columns.choices
139
  print("Selected Columns:", selected_columns)
140
  selected_columns = [
141
  c for c in filtered_data.columns if c in selected_columns or c == "Model Name"
 
126
  print("Search Term:", search_term)
127
  print("Selected Columns:", selected_columns)
128
  if isinstance(selected_columns, CheckboxGroup):
129
+ print("Selected Columns:", selected_columns.value)
130
  bak_selected_columns = copy.deepcopy(selected_columns)
131
  old_version = subset
132
  filtered_data = dataframes[subset]
 
135
  filtered_data.sort_values(by="Total", ascending=False, inplace=True)
136
  # selected_columns.append("Model Name")
137
  if isinstance(selected_columns, CheckboxGroup):
138
+ selected_columns = selected_columns.value
139
  print("Selected Columns:", selected_columns)
140
  selected_columns = [
141
  c for c in filtered_data.columns if c in selected_columns or c == "Model Name"