Skip to content
Snippets Groups Projects
Commit feb9ad49 authored by Vedrana Andersen Dahl's avatar Vedrana Andersen Dahl
Browse files

Update QUIZ_leaderboard.ipynb

parent 6cc80b24
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id:608c7b2a tags: %% Cell type:markdown id:608c7b2a tags:
# LEADERBOARD # LEADERBOARD
%% Cell type:code id:e5396acf tags: %% Cell type:code id:e5396acf tags:
``` python ``` python
import quizzes_helper as qh import quizzes_helper as qh
summary = qh.combine_weeks('_SUBMISSIONS/', week_list = [1, 2, 3, 4]) summary = qh.combine_weeks('_SUBMISSIONS/', week_list = [1, 2, 3, 4, 5])
qh.print_leaderboard(summary) qh.print_leaderboard(summary)
``` ```
%% Output %% Output
w1 w2 w3 w4 w1 w2 w3 w4 w5
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
Jojo 12 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ Jojo 15 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
AndrewK 10 ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ PaulineS 14 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✓
David 10 ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✗ ✓ ✓ David 13 ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓
PaulineS 9 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✗ ✗ AndrewK 12 ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✓
LeventeBuzga 9 ✓ ✓ ✓ ✓ ✓ ✓ - - - ✓ ✓ ✓ LeventeBuzga 12 ✓ ✓ ✓ ✓ ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓
Luca Saladino 8 ✓ ✓ ✓ - - - ✓ ✗ ✓ ✓ ✓ ✓ SportySpice 11 ✓ ✓ ✗ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
vince 8 ✓ ✓ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✗ Luca Saladino 11 ✓ ✓ ✓ - - - ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓
johnslim 8 ✗ ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓ johnslim 11 ✗ ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pbn 7 ✓ ✓ ✗ ✗ ✓ ✗ ✗ ✓ ✓ ✗ ✓ ✓ pbn 10 ✓ ✓ ✗ ✗ ✓ ✗ ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓
mp 7 ✓ ✓ ✓ - - - ✗ ✓ ✓ ✗ ✓ ✓ mp 10 ✓ ✓ ✓ - - - ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓
Anonyms 7 ✓ ✗ ✗ ✓ ✗ ✓ ✗ ✓ ✓ ✓ ✓ ✗ vince 9 ✓ ✓ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✗ ✗
Mathias 6 ✓ ✓ ✓ - - - - - - ✓ ✓ ✓ Rasmus 9 ✓ ✗ ✗ ✗ ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓
Rasmus 6 ✓ ✗ ✗ ✗ ✓ ✓ - - - ✓ ✓ ✓ Anonyms 7 ✓ ✗ ✗ ✓ ✗ ✓ ✗ ✓ ✓ ✓ ✓ ✗ - - -
SportySpice 5 ✓ ✓ ✗ ✗ ✗ ✗ ✓ ✓ ✓ - - - Mathias 7 ✓ ✓ ✓ - - - - - - ✓ ✓ ✓ ✗ ✓ ✗
andreama 4 ✓ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✓ ✓ ✓ andreama 5 ✓ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✓ ✓ ✓ ✗ ✓ ✗
kathariner 3 ✗ ✗ ✓ - - - - - - ✓ ✓ ✗ kathariner 3 ✗ ✗ ✓ - - - - - - ✓ ✓ ✗ - - -
JensL 2 ✓ ✓ ✗ - - - - - - - - - Emil 2 ✓ ✓ ✗ - - - - - - - - - - - -
Anna_E 2 ✓ ✗ ✓ - - - - - - - - - KnudMondrup 2 ✓ ✓ ✗ - - - - - - - - - - - -
Emil 2 ✓ ✓ ✗ - - - - - - - - - Anna_E 2 ✓ ✗ ✓ - - - - - - - - - - - -
KnudMondrup 2 ✓ ✓ ✗ - - - - - - - - - kathariner 2 - - - - - - - - - - - - ✓ ✓ ✗
Joakim_P 1 ✓ ✗ ✗ - - - - - - - - - JensL 2 ✓ ✓ ✗ - - - - - - - - - - - -
snoopy 1 ✓ ✗ ✗ - - - - - - - - - Joakim_P 2 ✓ ✗ ✗ - - - - - - - - - ✗ ✓ ✗
Ninna 1 ✗ ✗ ✓ - - - - - - - - - Sofia 1 ✓ ✗ ✗ - - - - - - - - - - - -
JBorregaard 1 ✗ ✓ ✗ - - - - - - - - - JBorregaard 1 ✗ ✓ ✗ - - - - - - - - - - - -
Sofia 1 ✓ ✗ ✗ - - - - - - - - - Thomas Hornum 1 ✗ ✓ ✗ - - - - - - - - - - - -
GenieVickery 1 ✓ ✗ ✗ - - - - - - - - - snoopy 1 ✓ ✗ ✗ - - - - - - - - - - - -
Thomas Hornum 1 ✗ ✓ ✗ - - - - - - - - - Ninna 1 ✗ ✗ ✓ - - - - - - - - - - - -
Jerry 1 ✓ ✗ ✗ - - - - - - - - - GenieVickery 1 ✓ ✗ ✗ - - - - - - - - - - - -
JWH 1 ✓ ✗ ✗ - - - - - - - - - Jerry 1 ✓ ✗ ✗ - - - - - - - - - - - -
100rocks 0 ✗ ✗ ✗ - - - - - - - - - JWH 1 ✓ ✗ ✗ - - - - - - - - - - - -
100rocks 0 ✗ ✗ ✗ - - - - - - - - - - - -
%% Cell type:markdown id:ddf7eb78 tags: %% Cell type:markdown id:ddf7eb78 tags:
# At the end of the course - finding the lucky quiz participant # At the end of the course - finding the lucky quiz participant
%% Cell type:code id:a0d98b67 tags: %% Cell type:code id:a0d98b67 tags:
``` python ``` python
# qh.plot_overview(summary) # qh.plot_overview(summary)
``` ```
%% Cell type:code id:65872a3f tags: %% Cell type:code id:65872a3f tags:
``` python ``` python
# chance = summary[['display name']].copy() # chance = summary[['display name']].copy()
# chance[['from', 'to']] = 0 # chance[['from', 'to']] = 0
# chance['to'] = summary.iloc[:, 2:].notna().sum(axis=1).cumsum() # chance['to'] = summary.iloc[:, 2:].notna().sum(axis=1).cumsum()
# chance['from'] = chance['to'].shift(1).fillna(0).astype(int) # chance['from'] = chance['to'].shift(1).fillna(0).astype(int)
# chance['to'] = chance['to'] - 1 # chance['to'] = chance['to'] - 1
# print(chance.to_string(index=False, header=True)) # print(chance.to_string(index=False, header=True))
``` ```
%% Cell type:code id:4c14c648 tags: %% Cell type:code id:4c14c648 tags:
``` python ``` python
# import random # import random
# import time # import time
# random.seed(time.time()) # random.seed(time.time())
# i = random.randint(0, chance['to'][-1]) # i = random.randint(0, chance['to'][-1])
# print(f'Random number is {i}') # print(f'Random number is {i}')
# winner = (chance['from']<= i) & (chance['to']>= i) # winner = (chance['from']<= i) & (chance['to']>= i)
# print(f'Lucky quiz participant is {chance[winner]["display name"].values[0]}') # print(f'Lucky quiz participant is {chance[winner]["display name"].values[0]}')
``` ```
%% Cell type:code id:feb044aa tags: %% Cell type:code id:feb044aa tags:
``` python ``` python
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment