Abhishek Thakur
commited on
Commit
·
48a5e54
1
Parent(s):
53034cd
fix
Browse files- competitions/submissions.py +29 -15
competitions/submissions.py
CHANGED
@@ -248,26 +248,40 @@ class Submissions:
|
|
248 |
first_submission = submissions_df.iloc[0]
|
249 |
if isinstance(first_submission["public_score"], dict):
|
250 |
# split the public score dict into columns
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
|
|
|
|
|
|
|
|
256 |
else:
|
257 |
first_submission = submissions_df.iloc[0]
|
258 |
if isinstance(first_submission["private_score"], dict):
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
submissions_df =
|
263 |
-
|
|
|
|
|
|
|
|
|
|
|
264 |
|
265 |
if isinstance(first_submission["public_score"], dict):
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
submissions_df =
|
270 |
-
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
return submissions_df
|
273 |
|
|
|
248 |
first_submission = submissions_df.iloc[0]
|
249 |
if isinstance(first_submission["public_score"], dict):
|
250 |
# split the public score dict into columns
|
251 |
+
temp_scores_df = submissions_df["public_score"].apply(pd.Series)
|
252 |
+
temp_scores_df = temp_scores_df.rename(columns=lambda x: "public_" + str(x))
|
253 |
+
submissions_df = pd.concat(
|
254 |
+
[
|
255 |
+
submissions_df.drop(["public_score"], axis=1),
|
256 |
+
temp_scores_df,
|
257 |
+
],
|
258 |
+
axis=1,
|
259 |
+
)
|
260 |
else:
|
261 |
first_submission = submissions_df.iloc[0]
|
262 |
if isinstance(first_submission["private_score"], dict):
|
263 |
+
# split the public score dict into columns
|
264 |
+
temp_scores_df = submissions_df["private_score"].apply(pd.Series)
|
265 |
+
temp_scores_df = temp_scores_df.rename(columns=lambda x: "private_" + str(x))
|
266 |
+
submissions_df = pd.concat(
|
267 |
+
[
|
268 |
+
submissions_df.drop(["private_score"], axis=1),
|
269 |
+
temp_scores_df,
|
270 |
+
],
|
271 |
+
axis=1,
|
272 |
+
)
|
273 |
|
274 |
if isinstance(first_submission["public_score"], dict):
|
275 |
+
# split the public score dict into columns
|
276 |
+
temp_scores_df = submissions_df["public_score"].apply(pd.Series)
|
277 |
+
temp_scores_df = temp_scores_df.rename(columns=lambda x: "public_" + str(x))
|
278 |
+
submissions_df = pd.concat(
|
279 |
+
[
|
280 |
+
submissions_df.drop(["public_score"], axis=1),
|
281 |
+
temp_scores_df,
|
282 |
+
],
|
283 |
+
axis=1,
|
284 |
+
)
|
285 |
|
286 |
return submissions_df
|
287 |
|