albertvillanova HF staff commited on
Commit
903948a
1 Parent(s): fb9885c

Simplify column names

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -75,7 +75,10 @@ def to_dataframe(data):
75
  def filter_results(df):
76
  df = df.loc[:, df.columns.str[0] == "results"]
77
  df = df.loc[:, ~df.columns.str[1].isin(EXCLUDED_RESULTS_KEYS)]
 
78
  df = df.loc[:, ~df.columns.str[2].isin(EXCLUDED_RESULTS_LEADERBOARDS_KEYS)]
 
 
79
  return df
80
 
81
 
@@ -83,6 +86,8 @@ def filter_configs(df):
83
  df = df.loc[:, df.columns.str[0] == "configs"]
84
  # df = df.loc[:, ~df.columns.str[1].isin(EXCLUDED_RESULTS_KEYS)]
85
  # df = df.loc[:, ~df.columns.str[2].isin(EXCLUDED_RESULTS_LEADERBOARDS_KEYS)]
 
 
86
  return df
87
 
88
 
 
75
  def filter_results(df):
76
  df = df.loc[:, df.columns.str[0] == "results"]
77
  df = df.loc[:, ~df.columns.str[1].isin(EXCLUDED_RESULTS_KEYS)]
78
+ # df.columns.str[1].str = df.columns.str[1].str.removeprefix("leaderboard_")
79
  df = df.loc[:, ~df.columns.str[2].isin(EXCLUDED_RESULTS_LEADERBOARDS_KEYS)]
80
+ df.columns = df.columns.str[1:]
81
+ df.columns = map(lambda x: (x[0].removeprefix("leaderboard_"), *x[1:]), df.columns)
82
  return df
83
 
84
 
 
86
  df = df.loc[:, df.columns.str[0] == "configs"]
87
  # df = df.loc[:, ~df.columns.str[1].isin(EXCLUDED_RESULTS_KEYS)]
88
  # df = df.loc[:, ~df.columns.str[2].isin(EXCLUDED_RESULTS_LEADERBOARDS_KEYS)]
89
+ df.columns = df.columns.str[1:]
90
+ df.columns = map(lambda x: (x[0].removeprefix("leaderboard_"), *x[1:]), df.columns)
91
  return df
92
 
93