{ "cells": [ { "cell_type": "markdown", "id": "608c7b2a", "metadata": {}, "source": [ "# LEADERBOARD" ] }, { "cell_type": "code", "execution_count": 1, "id": "e5396acf", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " w1 w2 w3 \n", " 1 2 3 1 2 3 1 2 3\n", " PaulineS 9 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓\n", " Jojo 9 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓\n", " David 8 ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓\n", " AndrewK 7 ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓\n", " vince 6 ✓ ✓ ✗ ✗ ✗ ✓ ✓ ✓ ✓\n", " LeventeBuzga 6 ✓ ✓ ✓ ✓ ✓ ✓ - - -\n", " johnslim 5 ✗ ✓ ✓ - - - ✓ ✓ ✓\n", "Luca Saladino 5 ✓ ✓ ✓ - - - ✓ ✗ ✓\n", " Anonyms 5 ✓ ✗ ✗ ✓ ✗ ✓ ✗ ✓ ✓\n", " pbn 5 ✓ ✓ ✗ ✗ ✓ ✗ ✗ ✓ ✓\n", " SportySpice 5 ✓ ✓ ✗ ✗ ✗ ✗ ✓ ✓ ✓\n", " mp 5 ✓ ✓ ✓ - - - ✗ ✓ ✓\n", " Mathias 3 ✓ ✓ ✓ - - - - - -\n", " Rasmus 3 ✓ ✗ ✗ ✗ ✓ ✓ - - -\n", " KnudMondrup 2 ✓ ✓ ✗ - - - - - -\n", " JensL 2 ✓ ✓ ✗ - - - - - -\n", " Emil 2 ✓ ✓ ✗ - - - - - -\n", " Anna_E 2 ✓ ✗ ✓ - - - - - -\n", " Ninna 1 ✗ ✗ ✓ - - - - - -\n", " Jerry 1 ✓ ✗ ✗ - - - - - -\n", " kathariner 1 ✗ ✗ ✓ - - - - - -\n", "Thomas Hornum 1 ✗ ✓ ✗ - - - - - -\n", " JWH 1 ✓ ✗ ✗ - - - - - -\n", " Sofia 1 ✓ ✗ ✗ - - - - - -\n", " JBorregaard 1 ✗ ✓ ✗ - - - - - -\n", " GenieVickery 1 ✓ ✗ ✗ - - - - - -\n", " snoopy 1 ✓ ✗ ✗ - - - - - -\n", " Joakim_P 1 ✓ ✗ ✗ - - - - - -\n", " andreama 1 ✓ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗\n", " 100rocks 0 ✗ ✗ ✗ - - - - - -\n" ] } ], "source": [ "import quizzes_helper as qh\n", "summary = qh.combine_weeks('_SUBMISSIONS/', week_list = [1, 2, 3])\n", "qh.print_leaderboard(summary)" ] }, { "cell_type": "markdown", "id": "ddf7eb78", "metadata": {}, "source": [ "# At the end of the course - finding the lucky quiz participant" ] }, { "cell_type": "code", "execution_count": 16, "id": "a0d98b67", "metadata": {}, "outputs": [], "source": [ "# qh.plot_overview(summary)" ] }, { "cell_type": "code", "execution_count": 17, "id": "65872a3f", "metadata": {}, "outputs": [], "source": [ "# chance = summary[['display name']].copy()\n", "# chance[['from', 'to']] = 0\n", "# chance['to'] = summary.iloc[:, 2:].notna().sum(axis=1).cumsum()\n", "# chance['from'] = chance['to'].shift(1).fillna(0).astype(int) \n", "# chance['to'] = chance['to'] - 1\n", "# print(chance.to_string(index=False, header=True))" ] }, { "cell_type": "code", "execution_count": 18, "id": "4c14c648", "metadata": {}, "outputs": [], "source": [ "# import random\n", "# import time\n", "# random.seed(time.time())\n", "# i = random.randint(0, chance['to'][-1])\n", "# print(f'Random number is {i}')\n", "# winner = (chance['from']<= i) & (chance['to']>= i)\n", "# print(f'Lucky quiz participant is {chance[winner][\"display name\"].values[0]}')" ] }, { "cell_type": "code", "execution_count": null, "id": "feb044aa", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "base", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.12" } }, "nbformat": 4, "nbformat_minor": 5 }