Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
b0e7256
1
Parent(s):
11eea6e
update
Browse files- __pycache__/app.cpython-310.pyc +0 -0
- app.py +9 -7
__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
@@ -77,7 +77,7 @@ def load_submissions():
|
|
77 |
total_submissions += 1
|
78 |
|
79 |
all_values = sum(len(v) for v in ids.values())
|
80 |
-
main_dict = {k: '{:.2
|
81 |
challenges = {k: Counter(v) for k, v in challenges.items()}
|
82 |
categories = {k: Counter(v) for k, v in categories.items()}
|
83 |
|
@@ -95,24 +95,26 @@ def get_dataframe_all():
|
|
95 |
|
96 |
challenges_frame = pd.DataFrame.from_dict(challenges).fillna(0).T
|
97 |
challenges_frame = challenges_frame.div(challenges_frame.sum(axis=1), axis=0)
|
98 |
-
challenges_frame = challenges_frame.applymap(lambda x: '{:.2%}'.format(x))
|
99 |
|
100 |
categories_frame = pd.DataFrame.from_dict(categories).fillna(0).T
|
101 |
categories_frame = categories_frame.div(categories_frame.sum(axis=1), axis=0)
|
102 |
-
|
|
|
|
|
|
|
103 |
|
104 |
main_frame = sort_by_highest_percentage(main_frame)
|
105 |
|
|
|
|
|
|
|
|
|
106 |
categories_frame = categories_frame.reindex(columns=main_frame.columns.to_list())
|
107 |
challenges_frame = challenges_frame.reindex(columns=main_frame.columns.to_list())
|
108 |
|
109 |
categories_frame = categories_frame.reset_index().rename(columns={'index': 'Category'})
|
110 |
challenges_frame = challenges_frame.reset_index().rename(columns={'index': 'Challenge'})
|
111 |
|
112 |
-
main_frame = main_frame.rename(columns={"": "NOT SOLVED"})
|
113 |
-
categories_frame = categories_frame.rename(columns={"": "NOT SOLVED"})
|
114 |
-
challenges_frame = challenges_frame.rename(columns={"": "NOT SOLVED"})
|
115 |
-
|
116 |
return total_submissions, main_frame, challenges_frame, categories_frame
|
117 |
|
118 |
TITLE = "# Open Parti Prompts Leaderboard"
|
|
|
77 |
total_submissions += 1
|
78 |
|
79 |
all_values = sum(len(v) for v in ids.values())
|
80 |
+
main_dict = {k: float('{:.2}'.format(len(v)/all_values)) for k, v in ids.items()}
|
81 |
challenges = {k: Counter(v) for k, v in challenges.items()}
|
82 |
categories = {k: Counter(v) for k, v in categories.items()}
|
83 |
|
|
|
95 |
|
96 |
challenges_frame = pd.DataFrame.from_dict(challenges).fillna(0).T
|
97 |
challenges_frame = challenges_frame.div(challenges_frame.sum(axis=1), axis=0)
|
|
|
98 |
|
99 |
categories_frame = pd.DataFrame.from_dict(categories).fillna(0).T
|
100 |
categories_frame = categories_frame.div(categories_frame.sum(axis=1), axis=0)
|
101 |
+
|
102 |
+
main_frame = main_frame.rename(columns={"": "NOT SOLVED"})
|
103 |
+
categories_frame = categories_frame.rename(columns={"": "NOT SOLVED"})
|
104 |
+
challenges_frame = challenges_frame.rename(columns={"": "NOT SOLVED"})
|
105 |
|
106 |
main_frame = sort_by_highest_percentage(main_frame)
|
107 |
|
108 |
+
main_frame = main_frame.applymap(lambda x: '{:.2%}'.format(x))
|
109 |
+
challenges_frame = challenges_frame.applymap(lambda x: '{:.2%}'.format(x))
|
110 |
+
categories_frame = categories_frame.applymap(lambda x: '{:.2%}'.format(x))
|
111 |
+
|
112 |
categories_frame = categories_frame.reindex(columns=main_frame.columns.to_list())
|
113 |
challenges_frame = challenges_frame.reindex(columns=main_frame.columns.to_list())
|
114 |
|
115 |
categories_frame = categories_frame.reset_index().rename(columns={'index': 'Category'})
|
116 |
challenges_frame = challenges_frame.reset_index().rename(columns={'index': 'Challenge'})
|
117 |
|
|
|
|
|
|
|
|
|
118 |
return total_submissions, main_frame, challenges_frame, categories_frame
|
119 |
|
120 |
TITLE = "# Open Parti Prompts Leaderboard"
|