patrickvonplaten commited on
Commit
6d4e0ea
1 Parent(s): 290fd7d
Files changed (2) hide show
  1. __pycache__/app.cpython-310.pyc +0 -0
  2. app.py +4 -11
__pycache__/app.cpython-310.pyc CHANGED
Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ
app.py CHANGED
@@ -51,14 +51,7 @@ def load_submissions():
51
 
52
  def sort_by_highest_percentage(df):
53
  # Convert percentage values to numeric format
54
- for column in df.columns.to_list():
55
- df[column] = pd.to_numeric(df[column].str.rstrip('%'))
56
-
57
- # Sort DataFrame by highest percentage first
58
- df = df.sort_values(by=column, ascending=False)
59
-
60
- # Convert back to percentage string format
61
- df[column] = df[column].astype(str) + '%'
62
 
63
  return df
64
 
@@ -74,14 +67,14 @@ def get_dataframe_all():
74
  categories_frame = categories_frame.div(categories_frame.sum(axis=1), axis=0)
75
  categories_frame = categories_frame.applymap(lambda x: '{:.2%}'.format(x))
76
 
77
- categories_frame = categories_frame.reset_index().rename(columns={'index': 'Category'})
78
- challenges_frame = challenges_frame.reset_index().rename(columns={'index': 'Challenge'})
79
-
80
  main_frame = sort_by_highest_percentage(main_frame)
81
 
82
  categories_frame = categories_frame.reindex(columns=main_frame.columns.to_list())
83
  challenges_frame = challenges_frame.reindex(columns=main_frame.columns.to_list())
84
 
 
 
 
85
  return main_frame, challenges_frame, categories_frame
86
 
87
  TITLE = "# Open Parti Prompts Leaderboard"
51
 
52
  def sort_by_highest_percentage(df):
53
  # Convert percentage values to numeric format
54
+ df = df[df.loc[0].sort_values(ascending=False).index]
 
 
 
 
 
 
 
55
 
56
  return df
57
 
67
  categories_frame = categories_frame.div(categories_frame.sum(axis=1), axis=0)
68
  categories_frame = categories_frame.applymap(lambda x: '{:.2%}'.format(x))
69
 
 
 
 
70
  main_frame = sort_by_highest_percentage(main_frame)
71
 
72
  categories_frame = categories_frame.reindex(columns=main_frame.columns.to_list())
73
  challenges_frame = challenges_frame.reindex(columns=main_frame.columns.to_list())
74
 
75
+ categories_frame = categories_frame.reset_index().rename(columns={'index': 'Category'})
76
+ challenges_frame = challenges_frame.reset_index().rename(columns={'index': 'Challenge'})
77
+
78
  return main_frame, challenges_frame, categories_frame
79
 
80
  TITLE = "# Open Parti Prompts Leaderboard"