vinid commited on
Commit
a21c491
·
1 Parent(s): 7bc20a6
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -51,6 +51,10 @@ def filter_and_pivot_leaderboard(selected_datasets, selected_conditions=None, se
51
  aggfunc='first'
52
  ).reset_index()
53
 
 
 
 
 
54
  # Sort by the first dataset score in descending order
55
  if selected_datasets and len(pivot_df) > 0 and len(pivot_df.columns) > 2:
56
  sort_col = pivot_df.columns[2] # First dataset column after Model and Type
 
51
  aggfunc='first'
52
  ).reset_index()
53
 
54
+ # Convert MultiIndex column headers to string format
55
+ if isinstance(pivot_df.columns, pd.MultiIndex):
56
+ pivot_df.columns = [' - '.join(col).strip() if isinstance(col, tuple) else col for col in pivot_df.columns]
57
+
58
  # Sort by the first dataset score in descending order
59
  if selected_datasets and len(pivot_df) > 0 and len(pivot_df.columns) > 2:
60
  sort_col = pivot_df.columns[2] # First dataset column after Model and Type