{"id":1387,"date":"2022-03-14T17:52:25","date_gmt":"2022-03-14T16:52:25","guid":{"rendered":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/?p=1387"},"modified":"2022-05-03T11:58:30","modified_gmt":"2022-05-03T09:58:30","slug":"projet-vortex-redaction-article-avant-tests","status":"publish","type":"post","link":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/2022\/03\/14\/projet-vortex-redaction-article-avant-tests\/","title":{"rendered":"Projet Vortex"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"630\" height=\"459\" src=\"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/03\/image-65.png\" alt=\"\" class=\"wp-image-1388\" srcset=\"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/03\/image-65.png 630w, http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/03\/image-65-300x219.png 300w\" sizes=\"(max-width: 630px) 100vw, 630px\" \/><\/figure>\n\n\n\n<p>objet d\u2019\u00e9tude : Vortex exp\u00e9rience<\/p>\n\n\n\n<p>pr\u00e9paration \u00e0 un d\u00e9fi en rapport avec le traitement de donn\u00e9es<\/p>\n\n\n\n<p>R\u00e9compense si la classe rel\u00e8ve le d\u00e9fi : invitation pour toute la classe \u00e0 une partie de VR en fin d\u2019ann\u00e9e \u00e0 Vortex exp\u00e9rience Bordeaux \ud83e\udd73<\/p>\n\n\n\n<p class=\"has-vivid-green-cyan-color has-text-color has-background\" style=\"background-color:#a5ffde\"><strong>Sous projet 1 : syst\u00e8me d\u2019exploitation du jeu<\/strong><\/p>\n\n\n\n<ul><li>Ouvrir le fichier BORDEAUX matches.csv<\/li><\/ul>\n\n\n\n<p>Ce fichier nous donne des informations sur les partie jou\u00e9es en Janvier \u00e0 Bordeaux<\/p>\n\n\n\n<p>Une ligne correspond \u00e0 une partie et le nombre de joueurs constituant l\u2019\u00e9quipe pour cette partie est donn\u00e9 par la colonne \u2018v\u2019.<\/p>\n\n\n\n<p>Il y a deux jeux diff\u00e9rents identifiables par la colonne game.<\/p>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\"><strong>Notre mission : \u00e9crire un programme capable de produire un fichier Excel.<\/strong><\/p>\n\n\n\n<p>Les donn\u00e9es doivent \u00eatres agr\u00e9g\u00e9es par dates avec le nombre de joueurs le nombre de parties et le d\u00e9tail pour chacun des jeux.<\/p>\n\n\n\n<p>Exemple de r\u00e9sultat attendu :<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/yb-isn.fr\/2021\/nsi\/wp-content\/uploads\/2022\/03\/image-1024x345.png\" alt=\"\" \/><\/figure>\n\n\n\n<p><strong> TESTS :<\/strong> (pas dans l&rsquo;ordre)<\/p>\n\n\n\n<ul><li>utiliser les codes de Poudlard, s\u00e9parer les donn\u00e9es avec des virgules (donn\u00e9es de BORDEAUX matches, qui ne sont pas s\u00e9par\u00e9es)<\/li><li>trier les donn\u00e9es en cat\u00e9gories (comme par exemple Botanique, Moldus, etc) pour clarifier<\/li><li>changer les ID du type de jeu (apocalypse ou origine) en apocalypse et origine (dictionnaires ?)<\/li><li>remettre les donn\u00e9es tri\u00e9es dans un tableau pour les voir en colonnes (avec les ID en apocalypse et origine)<\/li><li>organiser par jour (comme dans l&rsquo;exemple donn\u00e9 dans l&rsquo;article de blog)<\/li><li>ajouter une colonne avec 1 \u00e0 chaque ligne &#8211;&gt; lorsqu&rsquo;on agr\u00e8ge, ajouter les 1 &#8211;&gt; nombre de parties<\/li><li>regrouper nombre de joueurs par jour, de parties et selon ORIGINE et APOCALYPSE + le total de joueurs et d&rsquo;\u00e9quipes &#8211;&gt; sommes (sum) ?<\/li><li>calculer le nombre de joueurs par jour<\/li><\/ul>\n\n\n\n<p>pour voir l&rsquo;ensemble des tests sur google colab : <a href=\"https:\/\/colab.research.google.com\/drive\/1cATM2irayjCIlEBhPqdap1lUo225GfUx#scrollTo=7jpdpFF7VxQZ\">https:\/\/colab.research.google.com\/drive\/1cATM2irayjCIlEBhPqdap1lUo225GfUx#scrollTo=7jpdpFF7VxQZ<\/a><\/p>\n\n\n\n<p><strong>G\u00e9n\u00e9ralisation de la solution propos\u00e9e pr\u00e9c\u00e9demment<\/strong> : <a href=\"https:\/\/colab.research.google.com\/drive\/1vOhcVXVfuMPO9i6XEDKPuB8mdnDPYHoT\">https:\/\/colab.research.google.com\/drive\/1vOhcVXVfuMPO9i6XEDKPuB8mdnDPYHoT<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p> <\/p>\n\n\n\n<p class=\"has-vivid-green-cyan-background-color has-background\">Codes trouv\u00e9s par Lukas et Matthieu : <a href=\"https:\/\/colab.research.google.com\/drive\/1WQ0TJd9VBZ3RxHkYj7RhriLv1JeZyZm-?usp=sharing\">https:\/\/colab.research.google.com\/drive\/1WQ0TJd9VBZ3RxHkYj7RhriLv1JeZyZm-?usp=sharing<\/a><\/p>\n\n\n\n<p class=\"has-pale-cyan-blue-background-color has-background\">Corrig\u00e9 du sous projet 1 :<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"godzilla\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import pandas as pd\nmatches= pd.read_csv('BORDEAUX matches.csv',encoding = \"ISO-8859-1\")\n\ndef simplifie_date(val):\n  return str(val).split('T')[0]\n\nindexNames = matches[matches['startDatetime'].isnull()|matches['game'].isnull()|matches['__v'].isnull()].index\nmatches.drop(indexNames , inplace=True)\n\nmatches['date']=matches['startDatetime'].apply(simplifie_date)\nmatches['\u00e9quipe']=1\n\ngames = matches.groupby(\"game\")\norigine= games.get_group('5fc126fcabc9c6bb54078531')\napocalypse=games.get_group('604743157d0d2804c8abb4f8')\n\norigine_players=origine.groupby(['date'])['__v'].agg('sum').to_frame()\norigine_equipe=origine.groupby(['date'])['\u00e9quipe'].agg('sum').to_frame()\norigine_matches=pd.DataFrame()\norigine_players_equipe = pd.merge(origine_players,origine_equipe, on='date')\n\ndico={'__v':'players_origine','\u00e9quipe':'equipe_origine'}\norigine_players_equipe.rename(columns=dico,inplace=True)\n\napocalypse_players=apocalypse.groupby(['date'])['__v'].agg('sum').to_frame()\napocalypse_equipe=apocalypse.groupby(['date'])['\u00e9quipe'].agg('sum').to_frame()\napocalypse_matches=pd.DataFrame()\napocalypse_players_equipe = pd.merge(apocalypse_players,apocalypse_equipe, on='date')\napocalypse_players_equipe.rename(columns={'__v':'players_apocalypse','\u00e9quipe':'equipe_apocalypse'},inplace=True)\n\norigine_apocalypse_jour = pd.merge(origine_players_equipe,apocalypse_players_equipe, on='date')\n\norigine_apocalypse_jour['players']=origine_apocalypse_jour['players_origine']+origine_apocalypse_jour['players_apocalypse']\norigine_apocalypse_jour['equipes']=origine_apocalypse_jour['equipe_origine']+origine_apocalypse_jour['equipe_apocalypse']\n\norigine_apocalypse_jour.to_excel('1matches_origine_apocalypse_jour.xlsx',sheet_name='bordeaux')\n\nimport matplotlib.pyplot as plt\ngraphiques=['players_origine','players_apocalypse','players','equipe_origine','equipe_apocalypse','equipes']\nax=origine_apocalypse_jour.plot(y=graphiques,grid=True,kind=\"bar\",figsize=(20,10)) \nax.set_ylabel('nombre de joueurs par jour')\nax.set_xlabel('date')\nplt.show()<\/pre>\n\n\n\n<p>&#8211;&gt; <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"552\" src=\"https:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/04\/image-1024x552.png\" alt=\"\" class=\"wp-image-1616\" srcset=\"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/04\/image-1024x552.png 1024w, http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/04\/image-300x162.png 300w, http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/04\/image-768x414.png 768w, http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/04\/image.png 1193w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-vivid-green-cyan-color has-text-color has-background\" style=\"background-color:#aaffe0\"><strong>Sous projet 2 : syst\u00e8me de gestion des r\u00e9servations<\/strong><\/p>\n\n\n\n<p>La lecture de l\u2019onglet utile du fichier Excel se fait de la mani\u00e8re suivante :<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"godzilla\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># lecture fichier excel\nventes = pd.read_excel('BORDEAUX vortex.xlsx',sheet_name='1 6 D\u00e9tails des ventes')<\/pre>\n\n\n\n<p class=\"has-luminous-vivid-orange-color has-text-color\"> <strong>Notre mission : \u00e9crire un programme capable de produire un fichier Excel.<\/strong> <\/p>\n\n\n\n<p>Les donn\u00e9es sont agr\u00e9g\u00e9es par dates avec le nombre total de ventes (joueurs ) par jour avec le d\u00e9tail pour trois lots diff\u00e9rents.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"godzilla\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#cr\u00e9ation de 3 lots en fonction du 'produit' vendu\nlot1=\"lot1: VORTEX APOCALYPSE,VORTEX ORIGINE,VORTEX NOEL 12 17 ANS,\\\nVORTEX ORIGINE Tarif \u00e9tudiants,VORTEX APOCALYPSE Tarif Etudiants\"\nlot2=\"lot2: RESERVATION GIFT CARD VORTEX ORIGINE,RESERVATION GIFT CARD VORTEX APOCALYPSE\"\nlot3=\"lot3: CARTE CADEAU 1E ENTREE,Vortex Team building,Vortex Team Building Privatisation \"<\/pre>\n\n\n\n<p>Exemple de r\u00e9sultat attendu :<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"http:\/\/yb-isn.fr\/2021\/nsi\/wp-content\/uploads\/2022\/03\/image-1.png\" alt=\"\" \/><\/figure>\n\n\n\n<p><strong>TESTS :<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\">___________________________________________________________________________________________________<\/p>\n\n\n\n<p> <\/p>\n\n\n\n<p><strong>Syst\u00e8me d&rsquo;exploitation du jeu : <\/strong><a href=\"https:\/\/colab.research.google.com\/drive\/1cATM2irayjCIlEBhPqdap1lUo225GfUx#scrollTo=YGI3EQ10JZCi\">https:\/\/colab.research.google.com\/drive\/1cATM2irayjCIlEBhPqdap1lUo225GfUx#scrollTo=YGI3EQ10JZCi<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u00ab\u00a0tests\u00a0\u00bb : <a href=\"https:\/\/colab.research.google.com\/drive\/1cATM2irayjCIlEBhPqdap1lUo225GfUx#scrollTo=9seSHIa65OiJ\">https:\/\/colab.research.google.com\/drive\/1cATM2irayjCIlEBhPqdap1lUo225GfUx#scrollTo=9seSHIa65OiJ<\/a><\/p>\n\n\n\n<p><strong>Une solution :<\/strong> <a href=\"https:\/\/colab.research.google.com\/drive\/1eamP8G2XEVzdmDycmuAmcMyUYC_cIXaO\">https:\/\/colab.research.google.com\/drive\/1eamP8G2XEVzdmDycmuAmcMyUYC_cIXaO<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"godzilla\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import pandas as pd\nmatches= pd.read_csv('LYON matches.csv',encoding = \"ISO-8859-1\")\n\n# On filtre les donn\u00e9es\nindexNames = matches[matches['startDatetime'].isnull()|matches['game'].isnull()|matches['__v'].isnull()].index\nmatches.drop(indexNames , inplace=True)\n\n# On cr\u00e9e une colonne jeu contenant :ORIGINE ou APOCALYPSE\ngame_dict={'5fc126fcabc9c6bb54078531':('ORIGINE','STRASBOURG'),'610054587f55fe7bf700aa0d':('ORIGINE','BORDEAUX'),\n        '60c2255028f1140564738448':('ORIGINE','LYON','NANTES'),'620276133b92e988f6f8b392':('ORIGINE','LYON'),\n        '5fc126fcabc9c6bb54078531':('ORIGINE','STRASBOURG'),'60c34dc3053c0726808323f5':('ORIGINE','STRASBOURG'),\n        '6202748309b5e34235339277':('ORIGINE','NANTES'),\n        '604743157d0d2804c8abb4f8':('APOCALYPSE','BORDEAUX'),'604743157d0d2804c8abb4f9':('APOCALYPSE','STRASBOURG')}\n\nmatches['jeu']=matches['game'].apply(lambda t : game_dict[t][0])\n\n#On cr\u00e9e des groupes par jeux\nb=matches.groupby(\"jeu\")\njeux=matches['jeu'].unique().tolist()\ngroupes=[]\nfor val in jeux:\n    groupes.append(b.get_group(val))\n\nprint(jeux)<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import matplotlib.pyplot as plt \nif \"ORIGINE\" in jeux:\n    origine=b.get_group(val)\n    #on simplifie la date \n    date_origine=origine['startDatetime'].to_list()\n    dates_origine=[str(val).split('T')[0] for val in date_origine ]\n    players_origine=origine['__v'].to_list()\n\n    #on cree une nouvelle table\n    origine_matches=pd.DataFrame()\n    origine_matches['date']=dates_origine\n    origine_matches['players_origine']=players_origine\n    origine_matches['equipe_origine']=1\n    origine_players=origine_matches.groupby(['date'])['players_origine'].agg('sum').to_frame()\n    origine_equipe=origine_matches.groupby(['date'])['equipe_origine'].agg('sum').to_frame()\n    origine_players_equipe = pd.merge(origine_players,origine_equipe, on='date')\n    #visualisation\n    ax=origine_players_equipe.plot(y=['players_origine','equipe_origine'],grid=True,kind=\"bar\",figsize=(20,10)) \n    ax.set_ylabel('nombre de joueurs par jour')\n    ax.set_xlabel('date')\n                \nif \"APOCALYPSE\" in jeux :\n    apocalypse=b.get_group(val)\n    #on simplifie la date \n    date_apocalypse=apocalypse['startDatetime'].to_list()\n    dates_apocalypse=[str(val).split('T')[0] for val in date_apocalypse ]\n    players_apocalypse=apocalypse['__v'].to_list()\n\n    #on cree une nouvelle table        \n    apocalypse_matches=pd.DataFrame()\n    apocalypse_matches['date']=dates_apocalypse\n    apocalypse_matches['players_apocalypse']=players_apocalypse\n    apocalypse_matches['equipe_apocalypse']=1\n    apocalypse_players=apocalypse_matches.groupby(['date'])['players_apocalypse'].agg('sum').to_frame()\n    apocalypse_equipe=apocalypse_matches.groupby(['date'])['equipe_apocalypse'].agg('sum').to_frame()\n    apocalypse_players_equipe = pd.merge(apocalypse_players,apocalypse_equipe, on='date')\n   \n    #visualisation\n    ax=apocalypse_players_equipe.plot(y=['players_apocalypse','equipe_apocalypse'],grid=True,kind=\"bar\",figsize=(20,10)) \n    ax.set_ylabel('nombre de joueurs par jour')\n    ax.set_xlabel('date')\n\nif \"APOCALYPSE\" in jeux and \"ORIGINE\" in jeux:    \n    origine_apocalypse_jour = pd.merge(origine_players_equipe,apocalypse_players_equipe, on='date')\n    origine_apocalypse_jour['players']=origine_apocalypse_jour['players_origine']+origine_apocalypse_jour['players_apocalypse']\n    origine_apocalypse_jour['equipes']=origine_apocalypse_jour['equipe_origine']+origine_apocalypse_jour['equipe_apocalypse']\n    origine_apocalypse_jour\n    # on cree un fichier excel\n    origine_apocalypse_jour.to_excel('origine_apocalypse_jour.xlsx')\n    \n    #on visualise le r\u00e9sultat\n    ax=origine_apocalypse_jour.plot(y=['players','players_origine','players_apocalypse','equipes','equipe_origine','equipe_apocalypse'],grid=True,kind=\"bar\",figsize=(20,10)) \n    ax.set_ylabel('nombre de joueurs par jour')\n    ax.set_xlabel('date')\n    <\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"555\" src=\"https:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/05\/image-4-1024x555.png\" alt=\"\" class=\"wp-image-1665\" srcset=\"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/05\/image-4-1024x555.png 1024w, http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/05\/image-4-300x163.png 300w, http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/05\/image-4-768x416.png 768w, http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-content\/uploads\/sites\/4\/2022\/05\/image-4.png 1186w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>objet d\u2019\u00e9tude : Vortex exp\u00e9rience pr\u00e9paration \u00e0 un d\u00e9fi en rapport avec le traitement de donn\u00e9es R\u00e9compense si la classe rel\u00e8ve le d\u00e9fi : invitation pour toute la classe \u00e0 une partie de VR en fin d\u2019ann\u00e9e \u00e0 Vortex exp\u00e9rience Bordeaux \ud83e\udd73 Sous projet 1 : syst\u00e8me d\u2019exploitation du jeu Ouvrir le fichier BORDEAUX matches.csv [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":1650,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-json\/wp\/v2\/posts\/1387"}],"collection":[{"href":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-json\/wp\/v2\/comments?post=1387"}],"version-history":[{"count":30,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-json\/wp\/v2\/posts\/1387\/revisions"}],"predecessor-version":[{"id":1668,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-json\/wp\/v2\/posts\/1387\/revisions\/1668"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-json\/wp\/v2\/media\/1650"}],"wp:attachment":[{"href":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-json\/wp\/v2\/media?parent=1387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-json\/wp\/v2\/categories?post=1387"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/yb-isn.fr\/2021\/nsi\/raphaelle\/wp-json\/wp\/v2\/tags?post=1387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}