<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>SSPHub</title>
<link>https://ssphub.netlify.app/</link>
<atom:link href="https://ssphub.netlify.app/index.xml" rel="self" type="application/rss+xml"/>
<description>Blog du réseau des data scientists de la statistique publique</description>
<generator>quarto-1.9.37</generator>
<lastBuildDate>Tue, 16 Jun 2026 00:00:00 GMT</lastBuildDate>
<item>
  <title>Journées data science &amp; open-source</title>
  <link>https://ssphub.netlify.app/talk/2026-06-jdos/</link>
  <description><![CDATA[ 





<p>L’Insee organise deux journées dédiées à la contribution open-source les <strong>16 et 17 juin 2026</strong>. Les deux jours auront lieu au [<strong>Lieu de la transformation publique, 77 avenue de Ségur, 75015 Paris</strong>](https://cartes.gouv.fr/explorer-les-cartes?c=2.305609,48.847446&amp;z=18&amp;l=PLAN.IGN$GEOPORTAIL:GPP:TMS(1;1;1;0;standard)&amp;w=&amp;permalink=yes. Le but de ces journées est de démystifier l’open source, d’expliquer comment y contribuer, et d’encourager chacun à soutenir les projets utiles à la datascience.</p>
<section id="inscription" class="level1">
<h1>Inscription</h1>
<p>👉️ Les inscriptions se font <a href="https://grist.numerique.gouv.fr/o/ssphub/">ici</a>. 👈️ La journée se déroulera <strong>uniquement en présentiel</strong>.</p>
</section>
<section id="agenda" class="level1">
<h1>Agenda</h1>
<p>L’agenda plus détaillé est en construction mais voici les détails des journées.</p>
<ul>
<li>16 juin 2026 (9h30-17h30):
<ul>
<li>Matinée : accueil et présentation des principes de contribution à l’open source</li>
<li>Après-midi : séparation en groupes autour des différents projets et contributions</li>
</ul></li>
<li>17 juin 2026 (9h-17h):
<ul>
<li>Matinée : contributions</li>
<li>Après-midi : contributions et clôture</li>
</ul></li>
</ul>
</section>
<section id="projets-open-source" class="level1">
<h1>Projets open-source</h1>
<p>Les différents projets à date sont :</p>
<ul>
<li><a href="https://www.css.cnrs.fr/active-tigger/">Active Tigger</a> : une application de labellisation de données textuelles, proposant aussi des techniques d’active learning, et permettant d’entraîner des modèles de classification textuelle (CREST). Le repo lié est <a href="https://github.com/emilienschultz/activetigger/">ici</a> ;</li>
<li><a href="https://sndstoolers.github.io/sndsTools/">SNDSTools</a> : projet pour faciliter l’utilisation des données du système national de données de santé (SNDS) (Inria - Insee). Le repo lié est <a href="https://github.com/SNDStoolers/sndsTools">ici</a> ;</li>
<li><a href="https://github.com/Romanovytch/canar">CanaR</a> : projet visant à déployer en autonomie des chatbots personnalisés avec du RAG via un outil de commande.</li>
<li>une liste de sujets à traiter en autonomie (en groupe ou seul). La liste définitive sera présentée le jour J mais comprend par exemple :
<ul>
<li>Sur Onyxia ou le SSPCloud : compléter la documentation et les formations (notamment en R) ;</li>
<li>Créer une charte graphique SSP revealjs pour une extension Quarto.</li>
</ul></li>
</ul>
<p>Si vous êtes intéressés pour être sponsor et porter un projet open-source, nous sommes toujours intéressés par quelques sponsors 👑. Votre rôle : proposer des projets (open-source bien sûr) pertinents pour les data-scientists et auxquels les participants pourraient contribuer pendant l’évènement. Cela peut être un package R, Python, un site …</p>
<p>En tant que sponsor, vous devrez connaître le sujet (sans en être expert ou mainteneur) et le besoin associé. En amont, votre rôle sera d’identifier une ou plusieurs issues à traiter et de préparer les pré-requis techniques (repo Git, droits d’accès) pour que les contributeurs puissent se mettre en selle rapidement le jour J. Le jour J, vous pourrez présenter le projet et la problématique, puis participer au travail collectif dont le but sera de produire des contributions (pull-requests) pour répondre aux besoins identifiés.</p>
<p>Si vous avez des questions, que vous êtes intéressé pour proposer un sujet ou simplement pour participer, n’hésitez pas à nous contacter 👋 par <a href="mailto:ssphub-contact@insee.fr">mail</a> ou par Tchap.</p>
</section>
<section id="contact" class="level1">
<h1>Contact</h1>
<p>Pour toute information : <a href="mailto:ssphub-contact@insee.fr" class="email">ssphub-contact@insee.fr</a></p>


</section>

 ]]></description>
  <category>network</category>
  <category>event</category>
  <guid>https://ssphub.netlify.app/talk/2026-06-jdos/</guid>
  <pubDate>Tue, 16 Jun 2026 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/talk/2026-06-jdos/jdos.png" medium="image" type="image/png"/>
</item>
<item>
  <title>Génération de commentaire de graphiques : retour d’expérience sur les statistiques agricoles et pistes d’amélioration</title>
  <link>https://ssphub.netlify.app/talk/2026-04-ssm-agri/</link>
  <description><![CDATA[ 





<section id="présentation-de-latelier" class="level1">
<h1>Présentation de l’atelier</h1>
<p>Le SSM Agriculture a mené un PoC pour que des LLM génèrent des commentaires sur l’évolution d’indicateurs agricoles à partir de graphiques. Si l’approche semblait prometteuse pour produire un premier jet que les analystes pourraient ensuite affiner, un premier point d’étape a mis en évidence des limites importantes (erreurs fréquentes sur les valeurs numériques, inversions de tendances, comparaisons incorrectes entre territoires …).</p>
<p>Dans le cadre d’un travail de recherche, un étudiant de l’Ecole polytechnique a travaillé à rendre plus robuste cette expérimentation sous la supervision d’une chercheuse de l’INRIA. Il a ainsi mis en place un cadre d’analyse pour quantifier les erreurs et proposé des améliorations pour répondre aux défauts identifiés.</p>
<p><strong>Ils nous ont présenté leurs travaux le mardi 14 avril à 14h</strong>, en <a href="https://visio.numerique.gouv.fr/wvv-cwou-ugn">visio</a> et en présentiel à l’Insee (en salle 4C-458). Tout le monde est le bienvenu !</p>
</section>
<section id="replay-de-latelier" class="level1">
<h1>Replay de l’atelier</h1>
<div class="quarto-video"><video id="video_shortcode_videojs_video1" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2026-04-ssmagri/2026-04-ssm_agri.mp4"></video></div>
</section>
<section id="support-de-présentation" class="level1">
<h1>Support de présentation</h1>
<iframe src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2026-04-ssmagri/20260414_SSPHub_ComLLM_ALS.pdf" width="100%" height="600px">
<p>
Your browser does not support PDFs. <a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2026-04-ssmagri/20260414_SSPHub_ComLLM_ALS.pdf">Download the PDF instead.</a>
</p>
</iframe>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="38" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 37;"><span id="cb1-38"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb1-39">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2026-04-ssmagri/20260414_SSPHub_ComLLM_ALS.pdf"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-40">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides en pdf"</span></span>
<span id="cb1-41">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="expression">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="48" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 47;"><span id="cb2-48"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(slides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> message<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides"</span>){</span>
<span id="cb2-49">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> button <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb2-50"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;p class="text-center"&gt;</span></span>
<span id="cb2-51"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;a class="btn btn-primary btn-lg cv-download" href="</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" target="_blank"&gt;</span></span>
<span id="cb2-52"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">      &lt;i class="fa-solid fa-file-arrow-down"&gt;&lt;/i&gt;&amp;ensp;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>message<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb2-53"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;/a&gt;</span></span>
<span id="cb2-54"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;/p&gt;`</span></span>
<span id="cb2-55">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> button</span>
<span id="cb2-56">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="declaration">

</div>
</div>
</div>


</section>

 ]]></description>
  <category>LLM</category>
  <category>SSM Agriculture</category>
  <guid>https://ssphub.netlify.app/talk/2026-04-ssm-agri/</guid>
  <pubDate>Tue, 14 Apr 2026 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/talk/2026-04-ssm-agri/logo_SSM_AGRESTE.png" medium="image" type="image/png" height="78" width="144"/>
</item>
<item>
  <title>LLM, fusées et lapins cartographes : bienvenue dans le tur-fu</title>
  <link>https://ssphub.netlify.app/infolettre/infolettre_24/</link>
  <description><![CDATA[ 





<section id="bienvenue-à-la-vingt-quatrième-infolettre" class="level1">
<h1>Bienvenue à la <strong>vingt quatrième infolettre</strong> !</h1>
<p>C’est le printemps ! Le temps est bon, il fait <a href="https://www.rtl.be/actu/monde/international/jusqua-416degc-avant-meme-la-fin-de-lhiver-une-vague-de-chaleur-extreme-frappe/2026-03-19/article/783199">41,6°C en Californie avant même la fin de l’hiver</a>.</p>
<p>Bienvenue à cette infolettre, coécrite avec <strong>Mélina</strong> ❤️.</p>
</section>
<section id="linfographie" class="level1">
<h1>L’infographie</h1>
<p>Qu’il est difficile de choisir une seule infographie. Pour ce mois-ci, c’est finalement une vidéo de tous les lancements de fusée dans l’espace depuis 1957 (ne pas avoir peur de tout ce qu’il y a là-haut). Attention, grand final de lancements pour l’année 2025 !</p>
<p></p><div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/tUNZQCGKvbg" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div> <em>Source : données recueillies par Jonathan McDowell et disponibles sur <a href="https://planet4589.org">https://planet4589.org</a>, infographie faite par <a href="https://peteratwoodprojects.wordpress.com/">Peter Atwood</a> et explications aussi <a href="https://www.linkedin.com/posts/peter-atwood-60b9ba18a_cartography-gis-blender3d-ugcPost-7422329412764770305-jgGI/">ici</a>.</em><p></p>
<p>Le site <a href="https://satellitetracker3d.com/">satellitetracker</a> permet par ailleurs de suivre l’ensemble des quelques 12 000 satellites qui gravitent autour de la Terre. Et cela en fait un petit nombre autour de la planète bleue grise …</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_24/satellites_trackers.png" class="img-fluid figure-img"></p>
<figcaption>Premier contact à l’approche de la Terre</figcaption>
</figure>
</div>
</section>
<section id="les-prochains-évènements-du-réseau" class="level1">
<h1>Les prochains évènements du réseau</h1>
<p>Une foison d’événements et d’informations ce mois-ci. Pour résumer :</p>
<ul>
<li>Un nouvel <strong>Open Science Meet-up</strong> à propos des <em>replication packages</em> en économie le <strong>2 avril 2026</strong> - <a href="https://insee-fr.zoom.us/j/96879320424?pwd=JwbRv0BRGHtpzijofpph6UHStnV5gO.1">lien</a> ;</li>
<li>un atelier du réseau sur la <strong>génération de commentaires de graphique par LLM</strong> le <strong>mardi 14 avril 2026 à 10h</strong> - <a href="https://visio.numerique.gouv.fr/wvv-cwou-ugn">lien</a> ;</li>
<li>un appel à contribution pour la conférence uRos du <strong>18 au 20 novembre 2026</strong> à Paris.</li>
</ul>
<section id="replication-packages-en-économie---open-science-meet-up---jeudi-2-avril-2026-13h30-visio" class="level2">
<h2 class="anchored" data-anchor-id="replication-packages-en-économie---open-science-meet-up---jeudi-2-avril-2026-13h30-visio"><em>Replication packages</em> en économie - Open science Meet-up - 📅 jeudi 2 avril 2026 13h30, visio</h2>
<p>Le prochain Open Science Meet-up de l’Insee portera sur le thème : <strong>Replication packages en économie : préparation, bonnes pratiques et attentes des revues, surtout lorsque les données sont confidentielles.</strong></p>
<p>Pour s’assurer de la reproducibilité d’une analyse publiée, de nombreuses revues demandent désormais aux auteurs de fournir un <em>replication package</em>, c’est-à-dire l’ensemble des données, du code et de la documentation.</p>
<p>Lors de ce Meet-Up, <a href="https://www.ilr.cornell.edu/people/lars-vilhuber">Lars Vilhuber</a> (Cornell University), <em>data editor</em> à l’<em>American Economic Association</em>, présentera les principes et les bonnes pratiques associés à la préparation et à la diffusion des <em>replication packages</em>. Il reviendra notamment sur les exigences croissantes des revues scientifiques, les standards qui se développent dans la communauté économique et les enjeux de la reproductibilité des travaux empiriques.</p>
<p>Cette rencontre sera l’occasion d’échanger sur la manière dont ces pratiques contribuent au <strong>développement d’une recherche plus transparente et plus ouverte</strong>, en particulier dans les domaines de l’analyse économique et statistique.</p>
<p>Elle s’adresse à toutes celles et ceux qui souhaitent mieux comprendre les enjeux de la reproductibilité des analyses économiques et de la diffusion ouverte des travaux de recherche.</p>
<p><strong>Rendez-vous le jeudi 2 avril de 13h30 à 14h15 en distanciel à ce <a href="https://insee-fr.zoom.us/j/96879320424?pwd=JwbRv0BRGHtpzijofpph6UHStnV5gO.1">lien</a></strong>.</p>
</section>
<section id="génération-de-commentaire-de-graphiques-retour-dexpérience-sur-les-statistiques-agricoles-et-pistes-damélioration---mardi-14-avril-14h-paris-dg-insee-et-visio" class="level2">
<h2 class="anchored" data-anchor-id="génération-de-commentaire-de-graphiques-retour-dexpérience-sur-les-statistiques-agricoles-et-pistes-damélioration---mardi-14-avril-14h-paris-dg-insee-et-visio">Génération de commentaire de graphiques : retour d’expérience sur les statistiques agricoles et pistes d’amélioration - 📅 mardi 14 avril 14h, Paris (DG Insee) et visio</h2>
<p>Le SSM Agriculture essaye de générer par LLM des commentaires sur l’évolution d’indicateurs agricoles à partir de graphiques. Si l’approche semblait prometteuse pour produire un premier jet que les analystes pourraient ensuite affiner, un point d’étape a mis en évidence des limites importantes (erreurs fréquentes sur les valeurs numériques, inversions de tendances, comparaisons incorrectes entre territoires …).</p>
<p>Dans le cadre d’un travail de recherche, un étudiant de l’Ecole polytechnique a travaillé à rendre plus robuste cette expérimentation sous la supervision d’une chercheuse de l’INRIA. Il a ainsi mis en place un <strong>cadre d’analyse pour quantifier les erreurs et proposé des améliorations pour répondre aux défauts identifiés</strong>.</p>
<p><strong>Ils nous présenteront ainsi leurs travaux le mardi 14 avril à 14h</strong>, en <a href="https://visio.numerique.gouv.fr/wvv-cwou-ugn">visio</a> et en présentiel à l’Insee (en salle 4C-458). La présentation devrait durer 30 minutes. Tout le monde est le bienvenu !</p>
<p>Si vous voulez l’ajouter dans votre agenda, voici une <a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2026-04-ssmagri/202604_generationtxtgraphique.ics">invitation agenda</a>.</p>
<p>Les mises à jour seront faites sur la <a href="../../talk/2026-04-ssm-agri/index.html">page de l’événement</a>.</p>
</section>
<section id="contribuez-à-la-conférence-sur-lutilisation-de-r-dans-la-statistique-publique-uros---18-20-novembre-2026-paris" class="level2">
<h2 class="anchored" data-anchor-id="contribuez-à-la-conférence-sur-lutilisation-de-r-dans-la-statistique-publique-uros---18-20-novembre-2026-paris">Contribuez à la conférence sur l’utilisation de R dans la statistique publique (uROS) - 📅 18-20 novembre 2026, Paris</h2>
<p>L’Insee accueille l’édition 2026 de la <strong>conférence uRos (use of R in official statistics)</strong> les <strong>18, 19 et 20 novembre 2026</strong> au centre Pierre-Mendès France, à Bercy.</p>
<p>Cette rencontre annuelle des <strong>utilisateurs de R en Europe et dans le monde</strong> sera l’occasion de valoriser les nombreux investissements en R faits à l’Insee et au sein du SSP. La liste des thèmes ainsi que toutes les informations pratiques sont en ligne sur le <a href="https://r-project.ro/conference2026_FR.html">site de la conférence</a>.</p>
<p>Si vous souhaitez y <strong>assister</strong>, vous pouvez d’ores et déjà vous inscrire <a href="https://uros2026.sciencesconf.org/registration?lang=fr">en ligne</a>.</p>
<p>Si vous souhaitez <strong>contribuer</strong>, l’appel à contribution va bientôt ouvrir jusqu’au <strong>15 juin</strong> sur le site de la conférence. Vous pourrez soumettre :</p>
<ol type="i">
<li>une présentation classique de 15 minutes ;</li>
<li>une présentation flash de 5 minutes ;</li>
<li>un tutoriel d’environ 2 heures.</li>
</ol>
<p>N’hésitez pas à contacter directement l’organisation de l’événement sur <a href="mailto:uros2026@insee.fr">uros2026@insee.fr</a>.</p>
</section>
</section>
<section id="actualités" class="level1">
<h1>Actualités</h1>
<section id="données-tabulaires-le-deep-learning-est-il-devenu-une-alternative-crédible-aux-méthodes-de-boosting" class="level2">
<h2 class="anchored" data-anchor-id="données-tabulaires-le-deep-learning-est-il-devenu-une-alternative-crédible-aux-méthodes-de-boosting">Données tabulaires : le deep learning est-il devenu une alternative crédible aux méthodes de boosting ?</h2>
<p><a href="https://m-clark.github.io/posts/2026-03-01-dl-for-tabular-foundational/">Ce billet</a> de blog explique que, si le boosting reste une valeur sûre, plusieurs modèles récents - qu’il s’agisse de deep learning “classique” ou de modèles de <a href="https://arxiv.org/abs/2108.07258">fondation</a> - deviennent désormais <strong>réellement compétitifs</strong>. L’émergence de benchmarks plus rigoureux et de nouveaux outils facilite par ailleurs la comparaison et la prise en main de ces nouveaux modèles. <strong>Le principal frein reste toutefois le passage à l’échelle sur les très grands jeux de données</strong>, qui limite encore leur adoption.</p>
<p>Et pour les séries temporelles ? Le constat est <a href="https://berts-workshop.github.io/">proche</a>: les modèles de fondation progressent, mais les approches plus classiques restent très compétitives, et le principal enjeu est encore celui de l’évaluation, les résultats étant contrastés selon les benchmarks.</p>
</section>
<section id="des-pistes-intéressantes-pour-la-recherche-documentaire" class="level2">
<h2 class="anchored" data-anchor-id="des-pistes-intéressantes-pour-la-recherche-documentaire">Des pistes intéressantes pour la recherche documentaire</h2>
<p>Le projet <a href="https://github.com/VectifyAI/PageIndex">PageIndex</a> explore une approche de recherche documentaire sans base vectorielle, fondée sur une indexation hiérarchique des documents et une navigation par grand modèle de langage (LLM). Au lieu de découper le texte en <em>chunks</em> (des segments de texte issus du découpage d’un document) puis de faire une recherche par similarité dans une base vectorielle (c’est la méthode du <a href="https://arxiv.org/abs/2005.11401">RAG</a> classique), l’outil transforme un <strong>document long en un arbre hiérarchique</strong> - une sorte de table des matières enrichie pour les LLM - puis s’appuie sur cette structure pour guider la recherche des passages pertinents. L’objectif est de mieux traiter les <strong>documents longs et structurés</strong>, pour lesquels une simple recherche par similarité sur des <em>chunks</em> peut manquer de précision ou de contexte. L’approche est prometteuse et a l’intérêt de rendre le parcours de recherche plus lisible et plus traçable.</p>
<p>Ce <a href="https://www.anthropic.com/engineering/contextual-retrieval">billet</a> d’Anthropic sur le Contextual Retrieval propose une approche pour <strong>améliorer la recherche documentaire par RAG classique</strong>. L’idée est de conserver le schéma habituel (<em>chunks</em>, <em>embeddings</em>, <a href="https://en.wikipedia.org/wiki/Okapi_BM25">BM25</a>) mais d’ajouter à chaque <em>chunk</em> un court contexte explicatif généré à partir du document complet, afin d’éviter qu’un passage isolé perde les informations qui lui donnent son sens. Le billet indique que cette contextualisation réduit de 49 % les échecs de <em>retrieval</em>, et jusqu’à 67 % lorsqu’on y ajoute une étape de <em>reranking</em>. Le billet rappelle aussi un point utile : pour des bases documentaires “modestes” (moins de 200 000 <em>tokens</em>, soit environ 500 pages), il peut être plus simple de mettre directement tout le corpus dans le prompt, sans passer par l’étape RAG.</p>
</section>
<section id="dbt-duckdb-structurer-ses-pipelines-sql-avec-une-infrastructure-légère" class="level2">
<h2 class="anchored" data-anchor-id="dbt-duckdb-structurer-ses-pipelines-sql-avec-une-infrastructure-légère">dbt + DuckDB : structurer ses pipelines SQL avec une infrastructure légère</h2>
<p>Les outils <a href="https://rmoff.net/2026/02/19/ten-years-late-to-the-dbt-party-duckdb-edition">dbt + DuckDB</a> permettent de <strong>professionnaliser des traitements analytiques locaux</strong>. <a href="https://duckdb.org/">DuckDB</a> fournit un moteur SQL très rapide pour interroger et transformer des données, y compris directement depuis des fichiers Parquet. <a href="https://www.getdbt.com/">dbt</a> permet quant à lui d’ajouter une couche d’organisation : il aide à découper les traitements en étapes claires (sources, <em>staging</em>, tables finales), à gérer les dépendances entre modèles, à documenter les transformations, à tester la qualité des données etc. En d’autres termes, <strong>dbt fournit une méthode pour transformer une collection de scripts SQL en pipeline</strong> plus lisible, plus reproductible et plus maintenable.</p>
</section>
</section>
<section id="pour-aller-plus-loin-se-former" class="level1">
<h1>Pour aller plus loin / se former</h1>
<section id="apprendre-avec-lia" class="level2">
<h2 class="anchored" data-anchor-id="apprendre-avec-lia">Apprendre avec l’IA</h2>
<p>Utiliser l’IA pour apprendre, et pas seulement pour accélérer la production de code ? Le <strong>dépôt <a href="https://github.com/DrCatHicks/learning-opportunities">Learning Opportunities</a></strong> propose un plugin pour Claude Code qui déclenche de courts exercices de 10 à 15 minutes afin d’éviter l’illusion de compréhension que peuvent créer les assistants de code. Une approche intéressantes pour ceux qui souhaitent (continuer à) <strong>se former à l’heure du coding assisté par IA</strong>.</p>
</section>
<section id="microgpt-visualized-une-ressource-pour-comprendre-ce-quil-y-a-dans-un-gpt" class="level2">
<h2 class="anchored" data-anchor-id="microgpt-visualized-une-ressource-pour-comprendre-ce-quil-y-a-dans-un-gpt">MicroGPT Visualized : une ressource pour comprendre ce qu’il y a dans un GPT</h2>
<p>Pour mieux comprendre ce qui se passe réellement derrière les mots “<em>attention</em>”, “<em>transformer</em>”, “résidus” ou “<em>KV cache</em>”, <a href="https://microgpt.jtauber.com">MicroGPT Visualized</a> est une excellente découverte. Le site reprend le micro-GPT en Python d’Andrej Karpathy et le décompose en six étapes, du simple modèle bigramme jusqu’au <em>transformer</em> complet optimisé avec <em>Adam</em>, le tout avec <strong>schémas, animations et explications progressives</strong>.</p>
</section>
<section id="master-machine-learning-with-scikit-learn" class="level2">
<h2 class="anchored" data-anchor-id="master-machine-learning-with-scikit-learn">Master Machine Learning with scikit-learn</h2>
<p>Le livre en ligne <a href="https://mlbook.dataschool.io/">Master Machine Learning with scikit-learn</a> de Kevin Markham est une ressource très intéressante pour <strong>développer ou consolider ses bonnes pratiques en machine learning</strong>.</p>
</section>
</section>
<section id="fun" class="level1">
<h1>Fun</h1>
<section id="mapinou-un-jeu-mobile-pour-alimenter-la-recherche-et-mieux-comprendre-la-navigation-cartographique" class="level2">
<h2 class="anchored" data-anchor-id="mapinou-un-jeu-mobile-pour-alimenter-la-recherche-et-mieux-comprendre-la-navigation-cartographique">Mapinou : un jeu mobile pour alimenter la recherche et mieux comprendre la navigation cartographique</h2>
<p>Petite respiration carto ce mois-ci avec <a href="https://cartonumerique.blogspot.com/2026/03/mapinou.html"><strong>Mapinou</strong></a>, un jeu mobile gratuit développé par une équipe de recherche du LASTIG (IGN) dans le cadre du projet européen LostInZoom. En guidant un lapin à travers une carte de France multi-échelles, les joueurs produisent des données anonymes par leurs interactions avec la carte - zooms, déplacements, clics - que les chercheurs utilisent pour <strong>mieux comprendre les phénomènes de désorientation après zoom et concevoir des interfaces cartographiques plus fluides.</strong></p>


</section>
</section>

 ]]></description>
  <category>Infolettre</category>
  <guid>https://ssphub.netlify.app/infolettre/infolettre_24/</guid>
  <pubDate>Tue, 31 Mar 2026 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/infolettre/infolettre_24/orbital_launch.png" medium="image" type="image/png" height="79" width="144"/>
</item>
<item>
  <title>Analyse textuelle de documents longs : cas des accords d’entreprise</title>
  <link>https://ssphub.netlify.app/talk/2026-03-dares-conventions-collectives/</link>
  <description><![CDATA[ 





<section id="présentation-de-latelier" class="level1">
<h1>Présentation de l’atelier</h1>
<p>Les accords d’entreprise représente une <strong>importe quantité d’information librement accessible</strong>. Ces accords permettent d’analyser les décisions prises au niveau le plus fin de l’économie. Ils présentent cependant plusieurs enjeux méthodologiques puisqu’ils peuvent être assez longs (jusqu’à des dizaines de page) et représentent une importante masse de données à analyser. Quelles techniques mettre en oeuvre alors pour détecter les thémes abordés par ces accords et en extraire des informations ?</p>
<p>Les méthodes mises en place pour répondre à ces questions incluent :</p>
<ul>
<li>l’<strong>analyse fréquentielle</strong>, après nettoyage des données ;</li>
<li>la modélisation thématique en mobilisant les techniques <strong>LDA</strong> ou <strong>BERTopic</strong> ;</li>
<li>enfin la capacité à <strong>extraire de l’information</strong> (comme le nombre d’heures supplémentaires) en utilisant les récentes évolutions qu’ont apporté les <strong>RAG et des LLM</strong>.</li>
</ul>
<p>L’atelier était en présentiel à l’Insee (salle 4C-358) et en visio.</p>
<p>Pour plus d’information, la Dares a présenté son travail aux <a href="https://journees-methodologie-statistique.insee.net/analyse-textuelle-de-documents-longs-cas-des-accords-dentreprise/">Journées de méthodologie statistique de 2025</a>.</p>
</section>
<section id="replay-de-latelier" class="level1">
<h1>Replay de l’atelier</h1>
<div class="quarto-video"><video id="video_shortcode_videojs_video1" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2026-03-dares/2026-03_dares_extraction.mp4"></video></div>
</section>
<section id="support-de-présentation" class="level1">
<h1>Support de présentation</h1>
<div class="code-copy-outer-scaffold"><div id="cb1" class="sourceCode" style="background: #f1f3f5;">
<pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"></code></pre>
<iframe class="sourceCode yaml code-with-copy" src="https://cthiounn.github.io/presentation_analyse_textuelle_accords/#/title-slide">
</iframe>
</div></div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="43" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 42;"><span id="cb1-43"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb1-44">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2026-03-dares/Analyse_textuelle_documents_longs.pdf"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-45">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides en pdf"</span></span>
<span id="cb1-46">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="expression">

</div>
</div>
</div>
<p>La présentation est aussi disponible <a href="https://cthiounn.github.io/presentation_analyse_textuelle_accords/#/title-slide">en ligne</a>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="56" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 55;"><span id="cb2-56"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(slides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> message<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides"</span>){</span>
<span id="cb2-57">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> button <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb2-58"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;p class="text-center"&gt;</span></span>
<span id="cb2-59"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;a class="btn btn-primary btn-lg cv-download" href="</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" target="_blank"&gt;</span></span>
<span id="cb2-60"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">      &lt;i class="fa-solid fa-file-arrow-down"&gt;&lt;/i&gt;&amp;ensp;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>message<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb2-61"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;/a&gt;</span></span>
<span id="cb2-62"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;/p&gt;`</span></span>
<span id="cb2-63">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> button</span>
<span id="cb2-64">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="declaration">

</div>
</div>
</div>


</section>

 ]]></description>
  <category>extraction d&#39;information</category>
  <category>NLP</category>
  <category>DARES</category>
  <guid>https://ssphub.netlify.app/talk/2026-03-dares-conventions-collectives/</guid>
  <pubDate>Wed, 18 Mar 2026 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/talk/2026-03-dares-conventions-collectives/logo_Dares.png" medium="image" type="image/png" height="43" width="144"/>
</item>
<item>
  <title>L’IA dans l’oeil du cyclone</title>
  <link>https://ssphub.netlify.app/infolettre/infolettre_23/</link>
  <description><![CDATA[ 





<section id="bienvenue-à-la-vingt-troisième-infolettre" class="level1">
<h1>Bienvenue à la <strong>vingt troisième infolettre</strong> !</h1>
<p>Après <strong>Niels, Oriana et Pedro</strong>, trois tempêtes en 10 jours, nous revoici sous un ciel moins pluvieux. Qu’à cela ne tienne, je vous parie que la prochaine s’appellera <a href="https://meteofrance.com/actualites-et-dossiers/comprendre-la-meteo/comment-choisit-le-nom-dune-tempete"><strong>Regina</strong></a>. Bienvenue à la nouvelle infolettre, coécrite avec <strong>Laura</strong> ❤️.</p>
</section>
<section id="linfographie" class="level1">
<h1>L’infographie</h1>
<p>Dans la saison hivernale, ce mois-ci c’est le travail de l’agence italienne <a href="https://thevisualagency.com/about/">The Visual Agency</a> qui a été <a href="https://www.youtube.com/watch?v=yxLu5CpPUFI">sélectionné</a>. Ils ont transcrit les mots d’une conférence sur les sages et les rebelles (<em>i saggi e i rebelli in italiano 🇮🇹 </em>) en <strong>une chaine de montagnes</strong> dont la hauteur des sommets représente l’occurence des termes et la proximité entre sommets la proximité sémantique.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_23/tva_topography_talk.png" class="img-fluid figure-img"></p>
<figcaption><em>Source : The Visual Agency, Topography of a talk, <a href="https://thevisualagency.com/tva-blog-articles/topography-of-a-talk-between-vibe-coding-and-parametric-design/">lien</a></em></figcaption>
</figure>
</div>
<p>Et comme c’est le mois de février, je ne résiste pas à l’envie de mettre aussi en avant cette <strong>animation qui retrace les étapes</strong> de création d’une infographie réalisée avec ggplot lors d’un <a href="https://github.com/gkaramanis/tidytuesday">TidyTuesday</a>. Du tout premier graphique jusqu’à la version finale, elle condense en quelques secondes tout le travail d’analyse, d’itération et de mise en forme qui permet d’aboutir à l’illustration finale.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_23/gkaramanis_tour_de_france.gif" class="img-fluid figure-img"></p>
<figcaption><em>Source : <a href="https://toulouse-dataviz.notion.site/Newsletter-Toulouse-DataViz-46-2afc08a98edb80cd9c21ee622fe9712a">Toulouse data viz</a> et <a href="https://github.com/gkaramanis/tidytuesday/tree/master/2020/2020-week15">repo TidyTuesday</a></em></figcaption>
</figure>
</div>
</section>
<section id="les-prochains-évènements-du-réseau" class="level1">
<h1>Les prochains évènements du réseau</h1>
<section id="extraction-dinformation-dans-des-documents-longs-par-la-dares---18-mars-2026-14h-à-la-dg-insee-et-visio" class="level2">
<h2 class="anchored" data-anchor-id="extraction-dinformation-dans-des-documents-longs-par-la-dares---18-mars-2026-14h-à-la-dg-insee-et-visio">Extraction d’information dans des documents longs par la DARES - 📅 18 mars 2026 14h (à la DG Insee et visio)</h2>
<p>La Dares présentera ses <strong>travaux d’analyse des accords d’entreprise</strong>, des documents souvent très longs, pouvant compter plusieurs dizaines de pages. On y abordera les méthodes mises en œuvre pour repérer automatiquement les sujets traités dans ces accords et en extraire des informations pertinentes (par exemple, le nombre de jours de télétravail par semaine).</p>
<p>L’atelier se tiendra à la fois en présentiel à la DG de l’Insee (salle 4C-358) et en visio. Les détails sont disponibles dans <a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2026-03-dares/20260318_SSPHub_DARES_accords_entreprise.ics">cette invitation calendrier</a>.</p>
</section>
<section id="appel-à-projets-journées-de-contribution-à-lopen-source---16-17-juin-2026---paris" class="level2">
<h2 class="anchored" data-anchor-id="appel-à-projets-journées-de-contribution-à-lopen-source---16-17-juin-2026---paris">📣 Appel à projets : journées de contribution à l’open-source - 📅 16 &amp; 17 juin 2026 - Paris</h2>
<p>L’Insee organise <strong>deux journées dédiées à la contribution open-source les 16 et 17 juin 2026</strong>. Les deux jours auront lieu au <em>Lieu de la transformation publique</em> à Paris. Le but de ces journées est de démystifier l’open source, d’expliquer comment y contribuer, et d’encourager chacun à soutenir les projets que nous utilisons largement en datascience.</p>
<p>Pour préparer ces journées, nous <strong>recherchons quelques sponsors 👑</strong>. Leur rôle : proposer des projets (open-source bien sûr) pertinents pour les data-scientists et auxquels les participants pourraient contribuer pendant l’évènement. Cela peut être un package R, Python, un site …</p>
<p>En tant que sponsor, vous devrez <strong>connaître le sujet</strong> (sans en être expert ou mainteneur) et le besoin associé. En amont, votre <strong>rôle</strong> sera d’identifier une ou plusieurs <em>issues</em> à traiter et de préparer les pré-requis techniques (repo Git, droits d’accès) pour que les contributeurs puissent se mettre en selle rapidement le jour J. Le jour J, vous pourrez présenter le projet et la problématique, puis participer au travail collectif dont le but sera de produire des contributions (<em>pull-requests</em>) pour répondre aux besoins identifiés.</p>
<p>Si vous avez des questions, que vous êtes intéressé pour proposer un sujet ou simplement pour participer, n’hésitez pas à nous contacter 👋 par <a href="mailto:ssphub-contact@insee.fr">mail</a> ou par Tchap.</p>
</section>
</section>
<section id="actualités" class="level1">
<h1>Actualités</h1>
<section id="agents-ia-petites-catastrophes-et-grandes-conséquences" class="level2">
<h2 class="anchored" data-anchor-id="agents-ia-petites-catastrophes-et-grandes-conséquences">Agents IA : petites catastrophes (et grandes conséquences ?)</h2>
<p>L’usage des <strong>agents IA</strong> basés sur des grands modèles de langage (LLM) a pris de l’ampleur courant 2025, notamment grâce à l’émergence de frameworks et d’outils facilitant leur utilisation. Pour les plus novices, un agent IA est un système capable d’exécuter des tâches de manière autonome, en s’appuyant sur un LLM qui interprète les entrées et peut mobiliser un ensemble d’outils pour y répondre. L’agent peut ainsi <strong>“percevoir”</strong>, <strong>“raisonner”</strong>, <strong>“décider”</strong> et <strong>“agir”</strong> dans son environnement afin d’atteindre un objectif donné. On comprend donc qu’il peut exister quelques couacs dans l’utilisation de ces agents IA, c’est ce que nous allons voir dans les témoignages suivants :</p>
<ul>
<li><p><em>Quand un agent se venge pour un refus de contribution à un projet opensource</em> : <a href="https://theshamblog.com/an-ai-agent-published-a-hit-piece-on-me/"><strong>ce témoignage</strong></a> nous raconte comment un agent a pu publier des propos diffamants sur l’un des <em>maintainers</em> volontaires de la librarie Python mondialement connue <strong>Matplotlib</strong> ;</p></li>
<li><p><em>Quand un agent vole les clés d’API de son utilisateur</em> : <a href="https://www.reddit.com/r/ClaudeAI/comments/1r186gl/my_agent_stole_my_api_keys/?share_id=a4xNFtHEI1uNDLfrPOvxm&amp;utm_medium=android_app&amp;utm_name=androidcss&amp;utm_source=share&amp;utm_term=1"><strong>ce témoignage</strong></a> raconte cette fois le cas d’un agent qui, pour tester ne hypothèse, a pris quelques libertés… en accédant à un fichier auquel il n’était pas censé avoir accès. <em>Petit rappel : vos clé d’API 🔑, c’est comme vos clés d’appartement — à ne pas laisser traîner, sinon quelqu’un risque de venir squatter… et de vous laisser la facture</em> 👮.</p></li>
</ul>
<p>Enfin, <a href="https://www.robinlinacre.com/respectful_use_of_ai/"><strong>ce billet de blog</strong></a> revient sur une utilisation respectueuse de l’IA au sein des équipes de développement (qui peut être élargie à toute équipe travaillant sur un projet commun, qu’il soit statistique ou informatique).</p>
</section>
<section id="outils---locérisation-ou-les-llm-multimodaux-de-nouveaux-outils-open-source-pour-lextraction-de-texte-non-structuré" class="level2">
<h2 class="anchored" data-anchor-id="outils---locérisation-ou-les-llm-multimodaux-de-nouveaux-outils-open-source-pour-lextraction-de-texte-non-structuré">Outils - l’océrisation ou les LLM multimodaux : de nouveaux outils open source pour l’extraction de texte non structuré 📄</h2>
<p>Ces derniers mois, différents outils d’extraction d’information issus de textes non structurés ont émergé. On peut y retrouver :</p>
<ul>
<li><p>Le framework <a href="https://github.com/raphaelmansuy/edgequake"><strong>EdgeQuake</strong></a>, implémenté en Rust pour des performances élevées, permet de prendre en compte plus d’information sur la composition des textes que les RAG. En effet, là où les RAG se limitent à l’analyse de la similarité sémantique (<em>cf.</em> explications sur les RAG <a href="https://en.wikipedia.org/wiki/Retrieval-augmented_generation">ici</a> par exemple), EdgeQuake va décomposer le document en un graphe de connaissances, permettant de garder les relations structurelles entre les concepts ;</p></li>
<li><p>Plusieurs outils d’OCR (reconnaissance optique de caractère, permettant d’extraire du texte à partir d’images) ont été récemment mis à disposition en open source :</p>
<ul>
<li><a href="https://github.com/datalab-to/chandra?tab=Apache-2.0-1-ov-file"><strong>Chandra</strong></a>, mis à disposition par <em>datalab</em>, l’entreprise à l’origine du framwork <a href="https://github.com/datalab-to/marker?tab=readme-ov-file"><strong>marker-pdf</strong></a> et du moteur OCR <a href="https://github.com/datalab-to/surya"><strong>surya</strong></a> ;</li>
<li><a href="https://github.com/deepseek-ai/DeepSeek-OCR-2"><strong>DeepSeek-OCR-2</strong></a>, qui s’inspire de la lecture humaine pour reconstruire l’ordre logique de lecture, en plus de la détection des caractères ;</li>
<li>Le modèle OCR multimodal <a href="https://github.com/zai-org/GLM-OCR"><strong>GLM-OCR</strong></a>, qui analyse la structure globale du document en complément de la reconnaissance de caractères.</li>
</ul></li>
</ul>
</section>
<section id="un-petit-détour-côté-r" class="level2">
<h2 class="anchored" data-anchor-id="un-petit-détour-côté-r">Un (petit) détour côté R</h2>
<p>Et voici quelques news côté R / Posit :</p>
<ul>
<li><p>Après le benchmark des meilleurs codeurs R parmi les LLM le mois dernier, <a href="https://posit.co/blog/2026-01-16-ai-newsletter/"><strong>l’infolettre Posit</strong></a> de janvier apporte quelques informations sur l’utilisation de LLM ou d’agents IA dans Rstudio (notamment le tant attendu déploiement de l’IA dans Rstudio !) ;</p></li>
<li><p>Une liste de packages R utilisant des LLM est disponible <a href="https://luisdva.github.io/llmsr-book/r-pkgs.html">ici</a> (<em>bien que nous vous conseillons l’utilisation de Python si vous souhaitez travailler avec des LLM</em> 😉) ;</p></li>
<li><p>Un nouvel outil <a href="https://github.com/eitsupi/arf">arf</a> - <em>en cours de développement, pas encore stable</em> - se pose en console R moderne multiplateforme ;</p></li>
<li><p>Enfin, <a href="https://prodigious-trailblazer-3628.kit.com/posts/the-end-of-shiny"><strong>ce billet de blog</strong></a> revient sur les limites d’une application <strong>R Shiny</strong>, par rapport à une “vraie” application web. A l’ère des nouveaux outils de <em>vibe coding</em>, faut-il encore recourir à Rshiny, réputé pour sa simplicité d’utilisation ? Le débat est ouvert 🤔.</p></li>
</ul>
</section>
<section id="formation" class="level2">
<h2 class="anchored" data-anchor-id="formation">Formation 🏋️</h2>
<p>Ce mois-ci, voici des <strong>ressources intéressantes pour se former aux framework IA</strong> :</p>
<ul>
<li><p><a href="https://learn.deeplearning.ai/"><strong>DeepLearning.AI</strong></a> propose des cours (gratuits après inscription) sur différents modèles et outils d’IA. Cette plateforme a été fondée par Andrew Ng, qui y enseigne également 🤩 ;</p></li>
<li><p>Pour apprendre à utiliser <strong>Pytorch</strong>, <a href="https://www.learnpytorch.io/"><strong>learnpytorch</strong></a> est une excellente ressource : vidéos, notebooks (avec corrigés) et présentations sont disponibles. Les principaux modèles de deep learning y sont abordés (dont la classification et la computer vision), et il existe même un module consacré au déploiement de ces modèles. <em>Tout ce dont vous avez besoin pour maîtriser le package Insee <a href="https://github.com/InseeFrLab/torchTextClassifiers"><strong>torchTextClassifier</strong></a> comme personne</em> 👍.</p></li>
</ul>
</section>
<section id="fun" class="level2">
<h2 class="anchored" data-anchor-id="fun">Fun</h2>
<p>Vu la longueur de cette infolettre, nous vous gardons des petites pépites pour le mois prochain 😉</p>


</section>
</section>

 ]]></description>
  <category>Infolettre</category>
  <guid>https://ssphub.netlify.app/infolettre/infolettre_23/</guid>
  <pubDate>Sat, 28 Feb 2026 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/infolettre/infolettre_23/tva_topography_talk.png" medium="image" type="image/png" height="203" width="144"/>
</item>
<item>
  <title>La première infographie</title>
  <link>https://ssphub.netlify.app/infolettre/infolettre_22/</link>
  <description><![CDATA[ 





<section id="bienvenue-à-la-vingt-deuxième-infolettre" class="level1">
<h1>Bienvenue à la <strong>vingt deuxième infolettre</strong> !</h1>
<p>Bienvenue en 2026, l’année pendant laquelle les gens né(e)s en 2000 vont avoir 26 ans.</p>
</section>
<section id="linfographie" class="level1">
<h1>L’infographie</h1>
<p>Ce mois-ci, je vous propose de découvrir une infographie faite au XIX<sup>ième</sup> siècle (et à 88 ans !) par Charles Minard. Il s’agit de la <em>carte figurative des pertes successives en hommes de l’armée française dans la campagne de Russie 1812-1813</em>. Cette carte est considérée comme l’une des <strong>premières infographies modernes</strong> 🐓 et fait figurer :</p>
<ul>
<li>l’itinéraire de l’armée napoléonienne en Russie (en deux couleurs, pour la campagne à l’aller en rose et la retraite en noir) ;</li>
<li>la taille de l’armée, prenant en compte les arrivées et les morts ;</li>
<li>la température lors de la retraite (jusque -30<a href="https://fr.wikipedia.org/wiki/%C3%89chelle_R%C3%A9aumur">°R</a>, soit -37,5°C 🥶 ).</li>
</ul>
<p>A noter que des récentes analyses ADN ont montré que les causes de mortalité étaient sûrement multiples parmi les troupes napoléoniennes. En effet, le matériel génétique de maladies (typhus, diarrhée, fièvre paratyphoïde) a aussi <a href="https://www.lemonde.fr/sciences/article/2025/10/24/ces-infections-qui-ont-fauche-la-grande-armee-de-napoleon-en-1812_6649197_1650684.html">été retrouvé</a> dans des dépouilles le soldats napoléoniens.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_22/minard.jpeg" class="img-fluid figure-img"></p>
<figcaption><a href="https://heritage.ecoledesponts.fr/ark:/12148/btv1b10484829h/f52.item.r=minard"><em>Tableaux graphiques et cartes figuratives</em>, par Charles Minard</a></figcaption>
</figure>
</div>
<p>Cette carte est tellement connue qu’elle a été copiée, traduite, refaite avec les moyens modernes :</p>
<ul>
<li>la voici <a href="https://www.datavis.ca/gallery/re-minard.php">in English</a> ou <a href="https://www.datavis.ca/gallery/minard/minard-MarcoMeschini.png">in italiano</a> ;</li>
<li>en <a href="https://www.datavis.ca/gallery/minard/ggplot2/march.jpg">R (avec ggplot2)</a> ;</li>
<li>en <a href="https://www.datavis.ca/gallery/minard/Minard-IML.gif">SAS (pff, so 2025)</a>.</li>
</ul>
<p>Pour les curieux, le livre complet, comprenant d’autres très belles cartographies de Minard, sont disponibles dans les <a href="https://heritage.ecoledesponts.fr/ark:/12148/btv1b10484829h.r=minard?rk=257512%3B0">bien-heureuses archives numérisées de l’École des Ponts</a>.</p>
</section>
<section id="whats-up-le-réseau" class="level1">
<h1>What’s up le réseau ?</h1>
<section id="présentation-de-cartographia" class="level2">
<h2 class="anchored" data-anchor-id="présentation-de-cartographia">Présentation de Cartographia</h2>
<p>Le 13 janvier, nous avons reçu Françoise Bahoken et Nicolas Lambert. Ils nous ont présenté leur passionnant livre <a href="https://www.dunod.com/histoire-geographie-et-sciences-politiques/cartographia-comment-geographes-redessinent-monde">Cartographia</a>, qui explore ludiquement les grandes questions de la cartographie. Le livre rappelle aussi que toute cartographie est une <strong>simplification de la réalité</strong> et qu’elle comprend ainsi forcément un parti pris, dont il faut être conscient. L’enjeu est alors de ne pas chercher à manipuler l’information à travers une cartographie et de tenter d’adopter <strong>le point de vue le plus neutre possible</strong>.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_22/carto_manip.png" class="img-fluid figure-img"></p>
<figcaption>Comment des données identiques peuvent véhiculer un message totalement différent par les choix de visualisation effectués</figcaption>
</figure>
</div>
<p>Le replay et leur présentation sont <a href="../../talk/2026-01-cartographia/index.html">en ligne</a>.</p>
</section>
<section id="journée-contribution-open-source-16-17-juin-2026---paris" class="level2">
<h2 class="anchored" data-anchor-id="journée-contribution-open-source-16-17-juin-2026---paris">Journée contribution open source 📅 16 &amp; 17 juin 2026 - Paris</h2>
<p>A vos agendas ! Le SSPLab organise une journée autour de la contribution open-source les 16 et 17 juin 2026. Cela aura lieu au Lieu de la transformation publique à Paris. Le but de cette journée est de démystifier l’open source, d’expliquer comment y contribuer, et d’encourager chacun à soutenir les projets que nous utilisons largement en datascience.</p>
<p>Le programme est en cours d’élaboration donc si vous avez une idée de projets open-source d’intérêt auquel vous souhaitez contribuer, n’hésitez pas à nous contacter !</p>
</section>
</section>
<section id="actualités" class="level1">
<h1>Actualités</h1>
<p>Beaucoup d’actualités ce mois-ci, mais c’est plus calme côté data science 🤷‍♀️. Si vous n’êtes pas friands de techniques, et que vous avez déjà reçu 2 mails depuis que vous avez commencé à lire cette infolettre, vous pouvez passer la veille ce mois-ci 😉.</p>
<section id="llm" class="level2">
<h2 class="anchored" data-anchor-id="llm">LLM</h2>
<p>Dans la série agents, cet <a href="https://posit.co/blog/r-llm-evaluation-03/">article de Posit</a> compare <strong>différents modèles de LLM pour coder en R</strong> (sans les modèles de Mistral 😮🇫🇷😮). Résultat : les modèles les mieux évalués à date, mais attention les classements évoluent très vite, sont Claude Sonnet 4.5, Claude Opus 4.5 et OpenAI GPT-5.</p>
</section>
<section id="outils" class="level2">
<h2 class="anchored" data-anchor-id="outils">Outils</h2>
<p>Deux outils open-source pour synthétiser des données ou les valoriser.</p>
<ul>
<li>Si vous cherchez à générer des <strong>données synthétiques</strong>, il y a <a href="https://nvidia-nemo.github.io/DataDesigner/latest/">NeMo</a>. Open-source, l’objectif de ce package Python est de permettre de générer des données synthétiques facilement, en se branchant au LLM de votre choix.</li>
<li>Côté <strong>valorisation des données</strong>, il y a <a href="https://marmotdata.io/">Marmot</a>, un outil open-source pour parcourir plus facilement vos différents jeux de données.</li>
<li>Un peu plus d’<strong>interactivité dans des cellules de code en Quarto</strong> ? <a href="https://r-wasm.github.io/quarto-live/">Quarto-live</a> permet de faire des cellules de code réactives dans une page HTML Quarto.</li>
<li>Du côté des <strong>publications en ligne reproductibles et interactives</strong>, l’OFCE a publié depuis plusieurs années son package maison <a href="https://github.com/OFCE/ofce">OFCE</a>. Il permet de publier sur Internet les études de l’OFCE, en insérant des graphiques interactifs et en gérant aussi la charte graphique de l’OFCE.</li>
</ul>
</section>
<section id="formation" class="level2">
<h2 class="anchored" data-anchor-id="formation">Formation</h2>
<p>Quelques ressources intéressantes de formation ou articles de blog.</p>
<ul>
<li>Côté Python, le célèbre livre <a href="https://jakevdp.github.io/PythonDataScienceHandbook/"><em>Python datascience Handbook</em></a> est disponible aussi en version web ;</li>
<li>Pour comprendre la manière dont fonctionnent les <strong>filtres Bloom</strong> dans la technologie <strong>Parquet</strong>, je vous recommande ce <a href="https://www.icem7.fr/outils/les-filtres-de-bloom-dans-parquet/">très utile post de blog</a> d’Éric Mauvière.</li>
</ul>
</section>
<section id="fun" class="level2">
<h2 class="anchored" data-anchor-id="fun">Fun</h2>
<ul>
<li>Une excellente BD permet d’<strong>expliquer les statistiques facilement</strong> (aussi pour les enfants). Dans <a href="https://e-pedago.institut-agro-dijon.fr/bd-statistiques/"><em>Les statistiques en BD</em></a>, <a href="https://linkedin.com/in/laurence-dujourdy-b9a2a36">Laurence Dujourdy</a> et Mathieu Bartoletti vulgarisent simplement les concepts que l’on a appris il y a un certain temps. Le tout est dessiné par <a href="https://linkedin.com/in/thibault-roy-129b98195">Thibault Roy</a> et est porté par <a href="https://institut-agro-dijon.fr/">l’institut Agro de Dijon</a>.</li>
<li>Pour avoir une lecture sociale des évolutions de Paris, n’oubliez pas d’aller voir l’analyse <a href="https://www.lesechos.fr/politique-societe/societe/ce-que-la-carte-des-kebabs-revele-de-paris-2191635"><strong>Ce que la carte des kebabs révèle de Paris</strong></a> publiée dans <em>Les Echos</em>. A travers les kebabs, Jules Grandin analyse la géographie de Paris et son évolution. Il retrouve ainsi les grandes avenues, les gares, les quartiers densément peuplés et enfin les inégalités d’âge et de revenus.</li>
</ul>


</section>
</section>

 ]]></description>
  <category>Infolettre</category>
  <guid>https://ssphub.netlify.app/infolettre/infolettre_22/</guid>
  <pubDate>Fri, 30 Jan 2026 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/infolettre/infolettre_22/minard.jpeg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Françoise Bahoken et Nicolas Lambert, présentation de leur livre Cartographia</title>
  <link>https://ssphub.netlify.app/talk/2026-01-cartographia/</link>
  <description><![CDATA[ 





<section id="cartographia---comment-les-géographes-redessinent-le-monde---françoise-bahoken-et-nicolas-lambert" class="level2">
<h2 class="anchored" data-anchor-id="cartographia---comment-les-géographes-redessinent-le-monde---françoise-bahoken-et-nicolas-lambert"><a href="https://www.dunod.com/histoire-geographie-et-sciences-politiques/cartographia-comment-geographes-redessinent-monde">Cartographia</a> - comment les géographes (re)dessinent le monde - Françoise Bahoken et Nicolas Lambert</h2>
<p><strong>Replay de la présentation :</strong></p>
<div class="quarto-video"><video id="video_shortcode_videojs_video1" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2026-01-cartographia/2026-01-13-Cartographia.mp4"></video></div>
<iframe src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2026-01-cartographia/2026-01-13-Cartographia.pdf" width="100%" height="600px">
<p>
Your browser does not support PDFs. <a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2026-01-cartographia/2026-01-13-Cartographia.pdf">Download the PDF instead.</a>
</p>
</iframe>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="30" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 29;"><span id="cb1-30"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb1-31">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2026-01-cartographia/2026-01-13-Cartographia.pdf"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-32">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides"</span></span>
<span id="cb1-33">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="expression">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="39" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 38;"><span id="cb2-39"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(slides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> message<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides"</span>){</span>
<span id="cb2-40">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> button <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb2-41"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;p class="text-center"&gt;</span></span>
<span id="cb2-42"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;a class="btn btn-primary btn-lg cv-download" href="</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" target="_blank"&gt;</span></span>
<span id="cb2-43"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">      &lt;i class="fa-solid fa-file-arrow-down"&gt;&lt;/i&gt;&amp;ensp;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>message<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb2-44"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;/a&gt;</span></span>
<span id="cb2-45"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;/p&gt;`</span></span>
<span id="cb2-46">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> button</span>
<span id="cb2-47">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="declaration">

</div>
</div>
</div>


</section>

 ]]></description>
  <category>cartographie</category>
  <category>event</category>
  <guid>https://ssphub.netlify.app/talk/2026-01-cartographia/</guid>
  <pubDate>Tue, 13 Jan 2026 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/talk/2026-01-cartographia/cartographia.jpeg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Qui pour financer l’open source?</title>
  <link>https://ssphub.netlify.app/infolettre/infolettre_21/</link>
  <description><![CDATA[ 





<section id="bienvenue-à-la-vingt-et-unième-infolettre" class="level1">
<h1>Bienvenue à la <strong>vingt et unième infolettre</strong> !</h1>
<p>Début décembre, c’est le deuxième moment dur de l’année après juin. En septembre, on se dit qu’on fera tout cela d’ici Noël, large. Et puis on se réveille, c’est déjà début décembre, la to-do-list est loin d’être finie et la préparation des fêtes de fin d’année arrive à grand pas.</p>
<p>Allez, courage, <strong>dernier sprint</strong> de 2025 !</p>
</section>
<section id="linfographie" class="level1">
<h1>L’infographie</h1>
<p>Ce mois-ci, découvrez un outil pour visualiser les <strong>panaches de pollution aux particules fines (PM2.5)</strong> émis par 9&nbsp;500 sites les plus polluants dans plus de 2&nbsp;500 zones urbaines. <a href="https://climatetrace.org"><strong>ClimateTRACE</strong></a> reconstitue une journée type de pollution par ces sites à partir des conditions météorologiques réelles.</p>
<p>Spoiler : la pollution de la centrale électrique d’Ivry s’envole jusque très très loin …</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_21/climatetrace.png" class="img-fluid figure-img" width="800"></p>
<figcaption><em>source: <a href="https://climatetrace.org/air-pollution">ClimateTRACE</a></em></figcaption>
</figure>
</div>
</section>
<section id="actus-du-réseau" class="level1">
<h1>Actus du réseau</h1>
<section id="la-troisième-journée-du-réseau-a-eu-lieu-le-1er-décembre" class="level2">
<h2 class="anchored" data-anchor-id="la-troisième-journée-du-réseau-a-eu-lieu-le-1er-décembre">La troisième journée du réseau a eu lieu le 1<sup>er</sup> décembre</h2>
<p>Le 1<sup>er</sup> décembre 2025, le réseau a organisé sa troisième journée annuelle. Avec quatre présentations, deux interventions extérieures et un atelier de partage, cette édition a réuni une soixantaine de participants en présentiel et distanciel pour des échanges riches et constructifs. Merci à tous les participants pour leur participation active !</p>
<section id="les-présentations" class="level3">
<h3 class="anchored" data-anchor-id="les-présentations">Les présentations</h3>
<ol type="1">
<li><strong>Offre LLM du SSPCloud</strong> : L’Insee (DIIT) a présenté les <a href="https://llm.lab.sspcloud.fr/">nouvelles fonctionnalités</a> basées sur les modèles de langage (LLM) disponibles sur le SSPCloud, intégrant de manière plus poussée des fonctionnalités de complétion de code et d’analyses de données.</li>
<li><strong>Extraction des compétences dans <a href="https://dares.travail-emploi.gouv.fr/enquete-source/job-offers-collection-and-analysis-system">JOCAS</a></strong> : La Dares et l’Insee (DEE) ont partagé une version test de leur projet d’extraction des compétences numériques dans les offres d’emploi, combinant reconnaissance d’entités nommées et classification par LLM. Ce projet vise à améliorer l’analyse des métiers et des parcours professionnels.</li>
<li><strong>Automatisation des infos rapides justice</strong> : Le SSER (SSM Justice) a présenté son package R <code>chartegraphique.sser</code>, conçu pour automatiser la production des <a href="https://www.justice.gouv.fr/documentation/etudes-et-statistiques?categories%5B%5D=394&amp;items_per_page=10">infos rapides justice</a>. Les détails techniques sont disponibles sur le site des <a href="https://journees-methodologie-statistique.insee.net/automatisation-de-la-production-des-infos-rapides-justice-a-la-charte-graphique-du-sser-au-format-pdf-a-laide-dun-outil-combinant-rmarkdown-et-pagedown/">Journées de Méthodologie Statistique (JMS)</a>.</li>
<li><strong>Package de classification textuelle</strong> : L’Insee (SSPLab) a présenté <a href="https://pypi.org/project/torchtextclassifiers/">torchTextClassifiers</a>, un package Python de classification textuelle, étendant fastText et reposant sur PyTorch. Ce package permet d’entraîner des modèles maisons à taille réduite en gardant le contrôle de leur architecture.</li>
</ol>
</section>
<section id="atelier-collaboratif" class="level3">
<h3 class="anchored" data-anchor-id="atelier-collaboratif">Atelier collaboratif</h3>
<p>Un atelier d’échange entre les participants a permis de partager nos pratiques quotidiennes d’utilisation des outils d’IA pour les data scientists et statisticiens :</p>
<ol type="1">
<li>Quels sont nos cas d’usage?</li>
<li>Quels outils privilégier, et quels sont leurs avantages et limites ?</li>
</ol>
<p>Nos échanges, riches et nombreux, ont permis de partager des retours d’expérience concrets et nos bonnes (et moins bonnes) pratiques.</p>
</section>
<section id="invités" class="level3">
<h3 class="anchored" data-anchor-id="invités">Invités</h3>
<ol type="1">
<li>La <strong>Dinum</strong> a présenté les dernières évolutions de <a href="https://www.data.gouv.fr/">data.gouv.fr</a>, dont <code>data.pass</code>.</li>
<li>L’<strong>INA</strong> a présenté <a href="https://data.ina.fr/">data.ina</a>, un portail pour construire des indicateurs de suivi des médias.</li>
</ol>
<p>Les présentations et le replay de la journée sont disponibles sur la <a href="../../talk/2025-12-01-network-day/index.html">page de l’événement</a>.</p>
</section>
</section>
<section id="prochain-événement-présentation-de-cartographia---13-janvier-2026---format-mixte-montrouge-et-en-ligne" class="level2">
<h2 class="anchored" data-anchor-id="prochain-événement-présentation-de-cartographia---13-janvier-2026---format-mixte-montrouge-et-en-ligne">Prochain événement : présentation de Cartographia - 📅 13 janvier 2026 - format mixte (Montrouge et en ligne)</h2>
<p>Le prochain événement du réseau sera le <strong>13 janvier 2026</strong>. <a href="https://bsky.app/profile/fbahoken.bsky.social">Françoise Bahoken</a> et <a href="https://bsky.app/profile/neocarto.bsky.social">Nicolas Lambert</a> viendront nous parler de leur livre <a href="https://neocarto.hypotheses.org/22669"><strong>Cartographia</strong></a> et des questions de cartographie passionnantes qu’ils y abordent.</p>
<p>Nicolas Lambert était déjà intervenu pour présenter <a href="https://observablehq.com/">Observable</a>, une librairie JavaScript très pratique pour faire des dataviz.</p>
</section>
</section>
<section id="actualités" class="level1">
<h1>Actualités</h1>
<p>Une foule d’articles a été publiée dernièrement sur l’importance de l’open-source, son interdépendance avec les solutions payantes et le coût caché de sa maintenance. Et, bizarrement, il y a moins d’articles sur l’IA ce mois-ci 🤷‍♀️.</p>
<section id="résilience-et-open-source" class="level2">
<h2 class="anchored" data-anchor-id="résilience-et-open-source">Résilience et open-source</h2>
<section id="le-monde-numérique-est-très-interdépendant" class="level3">
<h3 class="anchored" data-anchor-id="le-monde-numérique-est-très-interdépendant">Le monde numérique est très interdépendant</h3>
<ul>
<li>De récents incidents ont rappelé que <strong>notre monde numérique est très interdépendant</strong> de solutions parfois lointaines. Un bug dans un logiciel ou service critique, open-source ou payant, se répercute ainsi rapidement à échelle mondiale. Cloudflare a par exemple connu une <a href="https://blog.cloudflare.com/18-november-2025-outage/">panne le 18 novembre 2025</a><sup>1</sup>, mettant KO de nombreux sites, y compris <a href="https://downdetector.fr/">downdetector</a> qui signale les pannes. La panne était due à une mise en production (ratée du coup). De la même manière, une <a href="https://www.lemonde.fr/pixels/article/2025/10/21/aws-le-service-cloud-d-amazon-annonce-avoir-resolu-la-panne-qui-a-touche-des-applications-dans-le-monde-entier_6648232_4408997.html">panne de DNS chez Amazon Web Services</a> le 20 octobre 2025 a perturbé de nombreuses applications dans le monde.</li>
</ul>
<div class="quarto-layout-panel" data-layout-ncol="2">
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.explainxkcd.com/wiki/images/d/d7/dependency.png" class="img-fluid figure-img" width="333"></p>
<figcaption><em>En 2020, par <a href="https://www.explainxkcd.com/wiki/index.php/2347:_Dependency">XKCD</a></em></figcaption>
</figure>
</div>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_21/xkcd_2025.jpg" class="img-fluid figure-img" width="350"></p>
<figcaption><em>En 2025, par <a href="https://bsky.app/profile/flipperpa.bsky.social/post/3m63xgtlh4k2d">Timothy A.</a></em></figcaption>
</figure>
</div>
</div>
</div>
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<p><em>La dépendance numérique en images</em></p>
</div>
</div>
</div>
</section>
<section id="lopen-source-dépend-du-travail-gratuit-dinconnus" class="level3">
<h3 class="anchored" data-anchor-id="lopen-source-dépend-du-travail-gratuit-dinconnus">L’open source dépend du travail gratuit d’inconnus</h3>
<ul>
<li>Au-delà de la simple interdépendance à des logiciels payants, le code open-source est souvent <strong>maintenu bénévolement par des inconnus</strong>, comme les secours en mer ou les pompiers volontaires.</li>
</ul>
<p>Un <a href="https://thenewstack.io/ffmpeg-to-google-fund-us-or-stop-sending-bugs/">débat</a> est ainsi apparu après que FFmpeg, un framework open-source vidéo largement utilisé (notamment par Chrome, Firefox ou YouTube), s’est retrouvé submergé de demande de correction de bugs, trouvés par l’IA de Google. Or dans l’open source, les bugs sont réparés par des mainteneurs, le plus souvent bénévoles, et qui ne peuvent plus suivre le rythme. Certaines personnes appellent ainsi Google, et plus largement les entreprises qui bénéficient de l’open-source et génèrent des revenus <del>supérieurs aux PIB de certains pays du monde</del>, à financer directement la maintenance des logiciels open-source qu’ils utilisent même si ce n’est pas qu’une question de financement.</p>
<ul>
<li>Des sous, des sous, des sous, oui mais combien ? On parle étonnamment de sommes plutôt faibles : à titre de comparaison, la fondation qui gère <strong>Python</strong> a un budget annuel de 5 millions de dollars. On l’apprend notamment dans ce <a href="https://pyfound.blogspot.com/2025/10/NSF-funding-statement.html">billet de blog</a> où la fondation explique pourquoi elle a refusé un financement de 1,5 million de dollars du gouvernement américain après l’avoir demandé (si vous n’avez pas le temps: c’est parce que le financement venait avec l’engagement de ne pas faire de promotion sur les thèmes de la diversité, de l’équité et de l’inclusion).</li>
</ul>
</section>
<section id="des-alternatives-existent" class="level3">
<h3 class="anchored" data-anchor-id="des-alternatives-existent">Des alternatives existent</h3>
<ul>
<li><strong>Blois</strong> : La ville a choisi de prendre la fin des mises à jour de Windows 10 comme une opportunité et de basculer vers <a href="https://www.blois.fr/info/2025/11/numeriquelibre-primtux">PrimTux</a>, une distribution Linux éducative.</li>
<li><strong>Cour internationale de justice (ICC)</strong> : En 2025, la Cour internationale de justice (qui dépend de l’ONU) et 9 de ses magistrats ont été ciblés par des sanctions américaines. Cela serait en soit une histoire en termes de souveraineté, mais vous avez déjà plus d’info en bas de page <sup>2</sup>. Le président de la Cour a ensuite perdu l’accès à ses mails. Les versions divergent ensuite : Microsoft a-t-il volontairement coupé l’accès du président à ses mails avant de le rétablir ou cela était-il juste un incident? Toujours est-il que la Cour internationale de justice a annoncé en octobre 2025 son intention de basculer vers <strong>des solutions européennes<sup>3</sup></strong>, comme rapporté par le <a href="https://www.handelsblatt.com/technik/it-internet/software-strafgerichtshof-ersetzt-microsoft-durch-deutsche-loesung/100166382.html">Handelsblatt (auf Deutsch 🇩🇪)</a>.</li>
</ul>
</section>
</section>
<section id="ia-ia-ia" class="level2">
<h2 class="anchored" data-anchor-id="ia-ia-ia">IA, IA, IA</h2>
<section id="les-modèles-de-langage-seraient-inversibles" class="level3">
<h3 class="anchored" data-anchor-id="les-modèles-de-langage-seraient-inversibles">Les modèles de langage seraient inversibles</h3>
<p>Une étude récente (<a href="https://arxiv.org/abs/2510.15511">Nikolaou et al., 2025</a>) montre que les modèles de language sont <strong>injectifs</strong><sup>4</sup> : chaque entrée est mappée à une représentation interne unique. Le papier propose par ailleurs un algorithme, <strong>SipIt</strong>, capable de reconstruire le prompt original avec 100% de réussite et rapidement.</p>
</section>
</section>
<section id="very-big-data-isnt-dead" class="level2">
<h2 class="anchored" data-anchor-id="very-big-data-isnt-dead">Very big data isn’t dead</h2>
<ul>
<li>Du mal à faire tourner des tables de 2 Go ? Imaginez le CERN, où le laboratoire du LHCb génère <strong>25 millions de collisions de protons par seconde</strong>, soit la paille de 4 To de données par seconde. Comment faire ? Comme expliqué dans <a href="https://lhcb-outreach.web.cern.ch/filtering-data-in-real-time/">ce post</a>, ils ont mis en place l’infrastructure pour filtrer les données et ne garder que 10 Go de données générées par seconde. C’est un peu la citation de Einstein :</li>
</ul>
<blockquote class="blockquote">
<p>Do not worry about your difficulties in mathematics; I can assure you that mine are still greater.</p>
</blockquote>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://lhcb-outreach.web.cern.ch/wp-content/uploads/2022/08/Run3_Trigger_LHCb-1024x560.png" class="img-fluid figure-img"></p>
<figcaption><em>Filtering data in real time, <a href="https://lhcb-outreach.web.cern.ch/filtering-data-in-real-time/">LHCb</a></em></figcaption>
</figure>
</div>
</section>
<section id="ressources-et-fun" class="level2">
<h2 class="anchored" data-anchor-id="ressources-et-fun">Ressources et fun</h2>
<section id="nouveaux-outils" class="level3">
<h3 class="anchored" data-anchor-id="nouveaux-outils">Nouveaux outils</h3>
<ul>
<li><strong>R</strong> : <a href="https://r-consortium.org/posts/jarl-just-another-r-linter/">Jarl</a>, un nouveau linter pour R, conçu pour être simple et efficace.</li>
<li><a href="https://murmure.al1x-ai.com/"><strong>Murmure</strong></a> : Un outil d’IA open-source pour générer des résumés et des analyses de texte hors ligne et en local, développé par <a href="https://www.al1x-ai.com/"><code>Al1X-AI</code></a>.</li>
</ul>
</section>
<section id="ressources-et-formation" class="level3">
<h3 class="anchored" data-anchor-id="ressources-et-formation">Ressources et formation</h3>
<ul>
<li><strong>IA</strong> : <a href="https://mikexcohen.substack.com/p/gender-bias-in-large-language-models">Gender Bias in Large Language Models</a> explique de manière très pédagogique le fonctionnement des LLM</li>
<li><strong>Python</strong> : <a href="https://blog.genesmindsmachines.com/p/python-is-not-a-great-language-for">Python is Not a Great Language for Data Science</a> : comment démarrer en Python, et une comparaison (subjective) entre Python et R</li>
<li><strong>Docker</strong> : <a href="https://muhammadraza.me/2024/building-container-runtime-python/">Voici un tuto</a> pour (un peu) démystifier les conteneurs et en construire un avec Python.</li>
</ul>
</section>
<section id="fun" class="level3">
<h3 class="anchored" data-anchor-id="fun">Fun</h3>
<ul>
<li><a href="https://adventofcode.com/"><strong>Advent of Code</strong></a> : Un calendrier de l’avent pour développeurs (au niveau certain).</li>
<li><strong>GenZ vs Boomers</strong> : Si vous ne savez pas si vous êtes côté boomer ou genZ, allez faire un tour sur <a href="https://github.com/hadley/genzplyr">genzplyr</a> et <a href="https://bradlindblad.github.io/boomerplyr/">boomerplyr</a> : vous comprendrez vite qu’il y a l’un des deux packages que vous ne comprenez pas. Je sais de quel côté je suis 👴.</li>
</ul>


</section>
</section>
</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Notes de bas de page</h2>

<ol>
<li id="fn1"><p>Ils ont même eu la bonne idée d’avoir une deuxième panne, plus rapidement réglée, le jour de la rédaction de cette infolettre 🙃.↩︎</p></li>
<li id="fn2"><p>Nicolas Guillou, juge français de la CPI qui faisait partie des juges ayant validé les mandats d’arrêt contre le premier ministre israélien et son ministre de la défense, explique dans <a href="https://www.lemonde.fr/international/article/2025/11/19/nicolas-guillou-juge-francais-de-la-cpi-sanctionne-par-les-etats-unis-face-aux-attaques-les-magistrats-de-la-cour-tiendront_6654016_3210.html">cet article du Monde</a> et dans son discours au congrès annuel de l’Union Syndicale des Magistrats (USM), <a href="https://www.union-syndicale-magistrats.org/sanctions-americaines-contre-le-juge-francais-de-la-cpi/#flipbook-df_41449/1/">ici</a>, ce que signifie concrètement vivre sous sanction américaine. Plus de carte Visa ou Mastercard, vos comptes clients dans des entreprises comme Amazon ou Airbnb sont fermés, des banques, même non implantées aux États-Unis, ferment votre compte bancaire par sur-application des règles (<em>over-compliance</em>). Vos proches sont aussi touchés : interdiction de séjourner aux États-Unis, expulsion s’ils y sont et, légalement parlant, vos proches de nationalité américaine ne peuvent plus vous fournir de service sinon ils pourraient être poursuivis pénalement aux États-Unis. Or, beaucoup de fonctionnaires français ont des enfants américains : il suffit que leurs enfants soient nés aux États-Unis quand les parents travaillaient à l’ambassade de France ou dans les institutions internationales et, grâce au droit du sol, les enfants sont aussi de nationalité américaine.↩︎</p></li>
<li id="fn3"><p>L’indépendance complète de ces solutions est par ailleurs sujette à débat.↩︎</p></li>
<li id="fn4"><p>vieux rappel de maths : injectif veut dire à peu près que si deux objects transformés sont les mêmes, c’est que les objets avant transformation sont les mêmes.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>Infolettre</category>
  <guid>https://ssphub.netlify.app/infolettre/infolettre_21/</guid>
  <pubDate>Wed, 10 Dec 2025 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/infolettre/infolettre_21/newsletter_21.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Troisième journée du SSPHub</title>
  <link>https://ssphub.netlify.app/talk/2025-12-01-network-day/</link>
  <description><![CDATA[ 





<section id="photos-de-lévénement" class="level1 page-columns page-full">
<h1>Photos de l’événement</h1>
<div class="column-page">
<div class="quarto-layout-panel" data-layout-ncol="2">
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: center;">
<p><img src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/IMG20251201122703_diff.jpg" class="img-fluid"></p>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: center;">
<p><img src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/IMG20251201122643_diff.jpg" class="img-fluid"></p>
</div>
</div>
</div>
<p><img src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/IMG20251201115612_diff.jpg" class="img-fluid" style="width:100.0%"></p>
</div>
</section>
<section id="inscription" class="level1">
<h1>Inscription</h1>
<p>👉️ Les inscriptions se font <a href="https://www.eventbrite.com/e/billets-3e-journee-du-reseau-des-data-scientists-1664052518879?aff=oddtdtcreator">ici</a>. 👈️ Possibilité de participer en présentiel et en ligne.</p>
</section>
<section id="agenda" class="level1">
<h1>Agenda</h1>
<ul>
<li><strong>9h30-10h</strong>: <strong>Accueil</strong>, moment de convivialité autour d’un café.</li>
<li><strong>10h-11h30</strong>: <strong>Retours d’expérience</strong> ;
<ul>
<li>Présentation de l’offre LLM du SSP Cloud, Insee - Division Innovation instruction technique (DIIT) ;</li>
<li>Extraire et analyser les compétences numériques dans les offres d’emploi grâce au NLP (Dares - Service statistique ministériel du Ministère du Travail et de l’Emploi &amp; Insee - DEE) ;</li>
</ul></li>
<li><strong>11h30-12h15</strong>: <strong>Atelier de partage</strong> sur l’usage de l’IA pour les <em>data scientists</em> et statisticiens :
<ul>
<li>quels assistants de code pour un <em>data scientist</em> / statisticien ?</li>
<li>assistants, agents &amp; vibe coding : partage d’expériences</li>
</ul></li>
<li><strong>12h15-14h</strong>: <strong>Pause déjeuner</strong>, moment de convivialité</li>
<li><strong>14h-14h45</strong>: invité : Quelles évolutions récentes et à venir sur <a href="https://www.data.gouv.fr/">data.gouv</a> (Dinum)</li>
<li><strong>14h45-16h15</strong>: <strong>Retours d’expérience</strong> sur l’extraction de données et la classification :
<ul>
<li>Automatisation des <a href="https://www.justice.gouv.fr/documentation/etudes-et-statistiques?categories%5B%5D=394&amp;items_per_page=10">Infos rapides Justice</a> grâce au package R <code>chartegraphique.sser</code> (SSER - SSM Justice) ;</li>
<li>Présentation du package torchTextClassifiers, qui propose un cadre unifié et agile pour la classification de texte, basé sur PyTorch et PyTorch Lightning (Insee - SSPLab) ;</li>
</ul></li>
<li><strong>16h15-16h45</strong>: <strong>Pause</strong>, moment de convivialité</li>
<li><strong>16h45-17h30</strong>: <strong><em>Keynote</em></strong> présentation du portail <a href="https://data.ina.fr/" class="uri">https://data.ina.fr/</a>, le service de l’exploration des médias utilisant l’IA pour établir les indicateurs sur les médias (personnalités les plus mentionnées, répartition du temps de parole entre femme et homme …)</li>
<li><strong>17h30-19h30</strong>: <strong>Pot</strong>, moment de convivialité</li>
</ul>
</section>
<section id="replay-et-présentations" class="level1">
<h1>Replay et présentations</h1>
<div class="code-copy-outer-scaffold"><div id="cb1" class="sourceCode" style="background: #f1f3f5;">
<pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"></code></pre>
<iframe class="sourceCode yaml code-with-copy" src="https://ssphub.github.io/2025_network_day/">
</iframe>
</div></div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="58" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 57;"><span id="cb1-58"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb1-59">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/0_general.pdf"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-60">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides"</span></span>
<span id="cb1-61">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="expression">

</div>
</div>
</div>
<section id="présentation-de-loffre-llm-du-ssp-cloud-insee---division-innovation-instruction-technique-diit" class="level2">
<h2 class="anchored" data-anchor-id="présentation-de-loffre-llm-du-ssp-cloud-insee---division-innovation-instruction-technique-diit">Présentation de l’offre LLM du SSP Cloud, Insee - Division Innovation instruction technique (DIIT)</h2>
<div class="quarto-video"><video id="video_shortcode_videojs_video1" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/1_SSPCloud_LLM.mp4"></video></div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="69" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 68;"><span id="cb2-69"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb2-70">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/1_SSPCloud_LLM.pdf"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-71">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides"</span></span>
<span id="cb2-72">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="expression">

</div>
</div>
</div>
</section>
<section id="extraire-et-analyser-les-compétences-numériques-dans-les-offres-demploi-grâce-au-nlp-dares---service-statistique-ministériel-du-ministère-du-travail-et-de-lemploi-insee---dee" class="level2">
<h2 class="anchored" data-anchor-id="extraire-et-analyser-les-compétences-numériques-dans-les-offres-demploi-grâce-au-nlp-dares---service-statistique-ministériel-du-ministère-du-travail-et-de-lemploi-insee---dee">Extraire et analyser les compétences numériques dans les offres d’emploi grâce au NLP (Dares - Service statistique ministériel du Ministère du Travail et de l’Emploi &amp; Insee - DEE)</h2>
<div class="quarto-video"><video id="video_shortcode_videojs_video2" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/2_JOCAS_DARES.mp4"></video></div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb3" data-startfrom="79" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 78;"><span id="cb3-79"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb3-80">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/2_JOCAS_DARES.pdf"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb3-81">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides"</span></span>
<span id="cb3-82">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-3" data-nodetype="expression">

</div>
</div>
</div>
</section>
<section id="quelles-évolutions-récentes-et-à-venir-sur-data.gouv-dinum" class="level2">
<h2 class="anchored" data-anchor-id="quelles-évolutions-récentes-et-à-venir-sur-data.gouv-dinum">Quelles évolutions récentes et à venir sur <a href="https://www.data.gouv.fr/">data.gouv</a> (Dinum)</h2>
<div class="quarto-video"><video id="video_shortcode_videojs_video3" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/3_Dinum_datagouv.mp4"></video></div>
<p>Présentation disponible sur <a href="https://www.figma.com/deck/bGTGzYw9ZDrLGzbOzJbwJp/D%C3%89MO-INSEE-1-DECEMBRE?node-id=4-3555&amp;viewport=-145%2C-74%2C0.69&amp;t=wS4mpPXywS1FgL52-1&amp;scaling=min-zoom&amp;content-scaling=fixed&amp;page-id=0%3A1" target="_blank">Figma</a></p>
</section>
<section id="automatisation-des-infos-rapides-justice-grâce-au-package-r-chartegraphique.sser-sser---ssm-justice" class="level2">
<h2 class="anchored" data-anchor-id="automatisation-des-infos-rapides-justice-grâce-au-package-r-chartegraphique.sser-sser---ssm-justice">Automatisation des <a href="https://www.justice.gouv.fr/documentation/etudes-et-statistiques?categories%5B%5D=394&amp;items_per_page=10">Infos rapides Justice</a> grâce au package R <code>chartegraphique.sser</code> (SSER - SSM Justice)</h2>
<div class="quarto-video"><video id="video_shortcode_videojs_video4" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/4_SSER_autoIRJ.mp4"></video></div>
<p>Le papier a été publié lors des <a href="https://journees-methodologie-statistique.insee.net/automatisation-de-la-production-des-infos-rapides-justice-a-la-charte-graphique-du-sser-au-format-pdf-a-laide-dun-outil-combinant-rmarkdown-et-pagedown/">journées de méthodologie statistique 2025</a>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb4" data-startfrom="97" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 96;"><span id="cb4-97"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb4-98">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/4_SSER_autoIRJ.pdf"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb4-99">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides"</span></span>
<span id="cb4-100">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-4" data-nodetype="expression">

</div>
</div>
</div>
</section>
<section id="le-package-torchtextclassifiers-un-cadre-unifié-pour-la-classification-de-texte-basé-sur-pytorch-et-pytorch-lightning-insee---ssplab" class="level2">
<h2 class="anchored" data-anchor-id="le-package-torchtextclassifiers-un-cadre-unifié-pour-la-classification-de-texte-basé-sur-pytorch-et-pytorch-lightning-insee---ssplab">Le package torchTextClassifiers, un cadre unifié pour la classification de texte basé sur PyTorch et PyTorch Lightning (Insee - SSPLab)</h2>
<div class="quarto-video"><video id="video_shortcode_videojs_video5" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/5_TorchTextClassifier_Insee.mp4"></video></div>
<div class="code-copy-outer-scaffold"><div id="cb1" class="sourceCode" style="background: #f1f3f5;">
<pre class="sourceCode yaml code-with-copy"><code class="sourceCode yaml"></code></pre>
<iframe class="sourceCode yaml code-with-copy" src="https://inseefrlab.github.io/codif-ape-prez/slides/jms-ttc-prez/">
</iframe>
</div></div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb5" data-startfrom="110" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 109;"><span id="cb5-110"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb5-111">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/5_TorchTextClassifier_Insee.pdf"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb5-112">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides"</span></span>
<span id="cb5-113">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-5" data-nodetype="expression">

</div>
</div>
</div>
</section>
<section id="le-portail-httpsdata.ina.fr-produire-des-indicateurs-de-suivi-des-médias-grâce-à-lia" class="level2">
<h2 class="anchored" data-anchor-id="le-portail-httpsdata.ina.fr-produire-des-indicateurs-de-suivi-des-médias-grâce-à-lia">Le portail <a href="https://data.ina.fr/" class="uri">https://data.ina.fr/</a>, produire des indicateurs de suivi des médias grâce à l’IA</h2>
<p><em>Cf.</em> le portail <a href="https://data.ina.fr/" class="uri">https://data.ina.fr/</a></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb6" data-startfrom="124" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 123;"><span id="cb6-124"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(slides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> message<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides"</span>){</span>
<span id="cb6-125">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> button <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb6-126"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;p class="text-center"&gt;</span></span>
<span id="cb6-127"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;a class="btn btn-primary btn-lg cv-download" href="</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" target="_blank"&gt;</span></span>
<span id="cb6-128"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">      &lt;i class="fa-solid fa-file-arrow-down"&gt;&lt;/i&gt;&amp;ensp;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>message<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb6-129"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;/a&gt;</span></span>
<span id="cb6-130"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;/p&gt;`</span></span>
<span id="cb6-131">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> button</span>
<span id="cb6-132">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-6" data-nodetype="declaration">

</div>
</div>
</div>
</section>
</section>
<section id="contact" class="level1">
<h1>Contact</h1>
<p>Pour toute information : <a href="mailto:ssphub-contact@insee.fr" class="email">ssphub-contact@insee.fr</a></p>
<p>📺️ La deuxième journée du réseau ayant eu lieu en 2024 est également <a href="../../talk/2024-10-14-network-day/index.html">disponible en replay</a>.</p>


</section>

 ]]></description>
  <category>network</category>
  <category>event</category>
  <guid>https://ssphub.netlify.app/talk/2025-12-01-network-day/</guid>
  <pubDate>Mon, 01 Dec 2025 00:00:00 GMT</pubDate>
  <media:content url="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img7.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>De belles cartographies, des packages R et l’importance des données d’entraînement pour l’IA</title>
  <link>https://ssphub.netlify.app/infolettre/infolettre_20/</link>
  <description><![CDATA[ 





<p>Bienvenue à la <strong>vingtième infolettre</strong> ! Il est temps de se mettre au défi de respecter ce qui a été dit il y a quelques semaines : une newsletter par mois ga-ran-tie je vous ai dit. Bon, à l’époque, je ne savais pas qu’un mois ça voulait dire 4 semaines et que 4, c’est pas beaucoup 🙃. Allez, on y va !</p>
<p>Bonne lecture 📔 !</p>
<section id="linfographie" class="level1">
<h1>L’infographie</h1>
<p>Beaucoup d’infographies ce mois-ci, le choix a été dur. Pour une fois, partons sur une vidéo réalisée par <a href="https://www.fabianlang.net/schweizer-bergwelten/">Fabian Lang</a> : le trajet d’un gypaète barbu suivi par GPS en 3D dans les Alpes suisses. La vraie infographie, en format vidéo, est disponible <a href="https://www.linkedin.com/posts/fbnlng_vulture-beardedvulture-cartography-activity-7274787245021188097-L9vj">ici</a>. Attention, vertige.</p>
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_20/2025_10_gypaete.png" class="img-fluid"></p>
</section>
<section id="actus-du-réseau" class="level1">
<h1>Actus du réseau</h1>
<section id="la-troisième-journée-du-réseau-1-décembre---la-tréso-malakoff" class="level2">
<h2 class="anchored" data-anchor-id="la-troisième-journée-du-réseau-1-décembre---la-tréso-malakoff">La troisième journée du réseau 📅 1 décembre - La Tréso (Malakoff)</h2>
<p>Les <strong>inscriptions</strong> pour la troisième journée du réseau le 1<sup>er</sup> décembre 2025 sont <a href="https://www.eventbrite.com/e/billets-3e-journee-du-reseau-des-data-scientists-1664052518879?aff=oddtdtcreator">ouvertes</a>. Si vous souhaitez présenter un sujet, n’hésitez pas à me contacter !</p>
</section>
<section id="présentation-de-cartographia---13-janvier-2026---format-mixte-montrouge-et-en-ligne" class="level2">
<h2 class="anchored" data-anchor-id="présentation-de-cartographia---13-janvier-2026---format-mixte-montrouge-et-en-ligne">Présentation de Cartographia - 📅 13 janvier 2026 - format mixte (Montrouge et en ligne)</h2>
<p><a href="https://bsky.app/profile/fbahoken.bsky.social">Françoise Bahoken</a> et <a href="https://bsky.app/profile/neocarto.bsky.social">Nicolas Lambert</a> vont venir nous parler de leur livre <a href="https://neocarto.hypotheses.org/22669">Cartographia</a> et des questions de cartographie (!) passionnantes qu’ils y abordent. Cela se passera <strong>le 13 janvier 2026</strong> en début d’après-midi, en format mixte : présentiel (à la DG de l’Insee) et à distance. Nicolas Lambert était déjà intervenu pour nous présenter Observable, une librairie Javascript très pratique pour faire des dataviz (<a href="../../talk/presentation-dobservable-par-nicolas-lambert/index.html">ici</a>, pour rappel). Si cela vous intéresse, réservez donc votre début d’après-midi !</p>
</section>
</section>
<section id="actualités" class="level1">
<h1>Actualités</h1>
<p>Ce mois-ci, place aux belles images et à la cartographie. L’IA reste omniprésente : les institutions cherchent à favoriser la réutilisation de leurs données, certains contournent les LLM avec des consignes écrites « en blanc sur blanc », et les données d’entraînement sont au centre de l’attention.</p>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Astuce
</div>
</div>
<div class="callout-body-container callout-body">
<p>Vous voyez d’autres sujets d’actualité intéressants ? N’hésitez pas à les partager sur le <a href="https://tchap.gouv.fr/#/room/#ssphub:agent.finances.tchap.gouv.fr">groupe Tchap 💬</a> directement !</p>
</div>
</div>
<section id="datavisualisation" class="level2">
<h2 class="anchored" data-anchor-id="datavisualisation">Datavisualisation</h2>
<ul>
<li>Une <a href="https://neocarto.hypotheses.org/21980">belle carte</a> de <strong>migration simulée au niveau infra-national</strong> en zone endémique paludéenne africaine. Françoise Bahoken, son autrice, sera notre invitée début 2026.<br>
</li>
<li>Pour les passionnés d’espace, voici une <a href="https://atlasof.space/"><strong>carte en 3D et dynamique</strong></a> du système solaire, comprenant les planètes mais aussi les astéroïdes! Vous pouvez jouer avec le temps pour savoir où sera la Terre quand vous aurez 30/40/50/60/70 ans (spoiler alert : c’est cyclique), et vérifier aussi qu’aucun astéroïde ne passe sur la Terre d’ici là.</li>
<li>Pour les autres candidats à l’infographie du mois :
<ul>
<li>pour voir l’ensemble des <strong>livres publiés</strong> en une seule carte interactive, cela donne <a href="https://phiresky.github.io/isbn-visualization/?">cela</a>.</li>
<li>la cheffe de l’infographie d’Epsiloon (magazine de sciences) a publié les étapes <a href="https://www.figma.com/proto/C8xDR9mlWX8kBV0crJr1IK/Les-infographies-d-Epsiloon?page-id=3102%3A2581&amp;node-id=3102-2979&amp;viewport=1040%2C640%2C0.18&amp;t=h0dF40xsTRgqYfJi-8&amp;scaling=scale-down-width&amp;content-scaling=fixed&amp;starting-point-node-id=3102%3A2583&amp;hide-ui=1">avant / après</a> de ses infographies. Je vous recommande celle sur les <strong>habitudes de sommeil par pays</strong>.</li>
</ul></li>
<li>Enfin, un petit jeu à la SUTOM en version graphique : un <a href="https://chartle.cc/"><strong>graphique par jour</strong></a>, devinez le pays !</li>
</ul>
</section>
<section id="cartographie" class="level2">
<h2 class="anchored" data-anchor-id="cartographie">Cartographie</h2>
<ul>
<li>Des chercheurs de l’Université de Charles (en Tchéquie) et de Freiburg ont publié une (très belle) <strong>taxonomie des bâtiments urbains</strong>, disponible en ligne. Tout est <a href="https://urbantaxonomy.org">ici</a> et vous pouvez explorer le bâti urbain de six pays d’Europe centrale et de l’est.<br>
</li>
<li>L’IGN a publié <a href="https://www.ign.fr/publications-de-l-ign/institut/kiosque/publications/atlas_anthropocene/2025/Atlas-2025-risque-inondation.pdf">une cartographie</a> très détaillée des <strong>risques d’inondation et de submersion</strong> sur tout le territoire national, notamment grâce aux images LIDAR. Par exemple, vous habitez à Saint-Maur-des-Fossés? Vous pouvez y voir la simulation d’une inondation majeure chez vous.<br>
</li>
<li>Utiliser l’<strong>IA pour faire des fonds de carte</strong> à partir d’image satellite ? Cela semble bien fonctionner d’après ce <a href="https://www.linkedin.com/posts/davidoesch_map-generation-geospatial-activity-7379129420801875968-yNzj">post</a>.</li>
<li>A partir des données d’utilisateurs de Facebook, des <a href="https://www.pnas.org/doi/10.1073/pnas.2409418122">chercheurs</a> ont bâti des <strong>indicateurs mensuels de flux migratoires</strong> couvrant 181 pays.</li>
<li>Après la prévisualisation de données Parquet en ligne, cette fois <a href="https://developmentseed.org/stac-map/">ce site</a> permet de <strong>visualiser très facilement des fichiers de données géographiques</strong> types STAC (dont Geoparquet). Explications sur la plomberie <a href="https://developmentseed.org/blog/2025-09-02-stacmap/">ici</a>.</li>
<li>La communauté Apache Sedona publie <a href="https://sedona.apache.org/latest/blog/2025/09/24/introducing-sedonadb-a-single-node-analytical-database-engine-with-geospatial-as-a-first-class-citizen/"><strong>SedonaDB</strong></a>, un moteur de base de données analytique open source et pensé nativement aussi pour des données spatiales.</li>
</ul>
</section>
<section id="le-reste-cest-le-r" class="level2">
<h2 class="anchored" data-anchor-id="le-reste-cest-le-r">Le reste c’est le R</h2>
<ul>
<li>Le <a href="https://vincentarelbundock.github.io/tinytable/">package R tinytable</a>, permet de faire des <strong>tableaux de qualité</strong> en de multiples formats. L’ambition de ce package est d’être simple, léger (0 dépendance à des packages externes), flexible et de différencier les données de l’affichage.</li>
<li>Le <a href="https://r-consortium.org/all-projects/2025-group-1.html#reviving-redoc">package R redoc</a> devrait être mis à jour. Il permet notamment de <strong>faire le lien entre Quarto, et la suite Office</strong>, par exemple si vous générez des documents qui seront relus par des personnes utilisant Word comme outil de travail 😉.<br>
</li>
<li>En machine learning, quels sont les problèmes posés par des <strong>classes d’apprentissage de tailles très différentes</strong> ? Selon cet <a href="https://datascience.stackexchange.com/questions/134389/is-class-imbalance-really-a-problem-in-machine-learning">article</a>, il s’agit surtout 1/ d’avoir des métriques de performance adéquates, 2/ d’avoir un nombre absolu d’observations dans la classe minoritaire suffisant (et non une part dans le total) et enfin 3/ de faire attention à la fongibilité entre classes.</li>
</ul>
</section>
<section id="ia" class="level2">
<h2 class="anchored" data-anchor-id="ia">IA</h2>
<ul>
<li>Qu’est-ce que les <strong>paramètres des modèles publiés</strong> disent des données d’entraînement sous-jacentes, confidentielles ? Des chercheurs sont <a href="https://fi-le.net/oss/">allés fouiller</a> ce que cache GPT-5.</li>
<li>Du côté de <strong>l’entraînement des modèles</strong>, la gamme des données disponibles s’enrichit pour que ses données soient mieux reprises par l’IA. C’est un nouvel épisode de la course à ne pas finir page 15 des résultats Google ou page 259 des blogs Myspace.
<ul>
<li><strong>Wikidata</strong>, qui stocke les données structurées de Wikipédia et consorts, propose maintenant ses données sous format de <a href="https://www.wikidata.org/wiki/Wikidata:Embedding_Project/October_1_2025_Release">données vectorielles</a>.</li>
<li>Un programme d’<strong>harmonisation des metadata et d’API</strong>, l’<a href="https://www.snowflake.com/en/blog/open-semantic-interchange-ai-standard/">Open Semantic Interchange Initiative</a>, a été lancé pour enrichir les données d’apprentissage et la précision des IA. L’idée est d’avoir un langage YAML commun pour permettre aux IA d’échanger des données de manière robuste, par exemple par API et sans perte de sens au fur et à mesure de leur traitement par des agents d’IA.</li>
<li>Une fois que l’on a les données, on cherche ensuite à savoir de <strong>combien de GPU j’ai besoin pour entraîner mon modèle</strong>. La Dinum a développé <a href="https://github.com/etalab-ia/InfraScale">un outil</a> pour estimer ses besoins pour cette étape.</li>
</ul></li>
<li>Des faiblesses des modèles de LLM sont, comme toujours, remontées, notamment sur <strong>l’importance des données d’apprentissage et d’un prompt propre</strong>. Cela met notamment en valeur le fait que les modèles ne sont pour le moment pas très efficaces quand il s’agit de trier des CV ou des articles.
<ul>
<li>Le “prompt injection” : c’est l’idée de truquer l’IA dans son CV/projet d’article scientifique/sur Linkedin, par exemple avec des instructions écrites en « blanc sur blanc », pour avoir plus de chance d’être sélectionné/de détecter les messages écrits par l’IA. Cela marche à presque 100 % des cas selon <a href="https://arxiv.org/pdf/2509.10248">cet article</a>, d’autant plus que l’IA a un biais positif naturel.</li>
<li>Une <a href="https://www.anthropic.com/research/small-samples-poison">étude</a> confirme que l’IA est <strong>particulièrement sensible à la qualité de la donnée d’apprentissage</strong>. Ainsi, 250 observations fausses suffisent pour empoisonner durablement un LLM, et ce <strong>quel que soit sa taille</strong>. Une <a href="https://www.youtube.com/watch?v=zKW8sVIOCTY">présentation intéressante</a> à une conférence PyData présentait par ailleurs ce qu’il se passait quand on entraîne une IA sur des images générés par une IA, avec des résultats similaires.<br>
</li>
</ul></li>
<li>Le site <a href="https://aidarwinawards.org/nominees-2025.html"><strong>AI Darwin Awards</strong></a> rassemble des exemples d’usage raté d’IA. Globalement, les cas d’usage où l’IA est mis directement face à un client peuvent rapidement mal tourner… Peut-être que <a href="https://www.politico.eu/article/albania-apppoints-worlds-first-virtual-minister-edi-rama-diella/">Diella</a>, la première et seule ministre à être une IA dans le monde, rejoindra cette liste ?</li>
<li>Si vous voulez <strong>comparer le résultat de deux LLM et leur empreinte carbone</strong>, n’oubliez pas l’outil <a href="https://comparia.beta.gouv.fr/">ComparIA</a> créé par une start-up d’État du ministère de la Culture.</li>
</ul>
</section>
</section>
<section id="la-non-interview-du-mois" class="level1">
<h1>La non interview du mois</h1>
<p>Pas d’interview finie en temps et en heure ce mois-ci, priorité au direct, ce sera donc (peut-être) le mois prochain !</p>


</section>

 ]]></description>
  <category>Infolettre</category>
  <guid>https://ssphub.netlify.app/infolettre/infolettre_20/</guid>
  <pubDate>Sat, 25 Oct 2025 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/infolettre/infolettre_20/newsletter_20.png" medium="image" type="image/png" height="96" width="144"/>
</item>
<item>
  <title>La rentrée 2025: actualités, nouveautés, interview de rentrée</title>
  <link>https://ssphub.netlify.app/infolettre/infolettre_19/</link>
  <description><![CDATA[ 





<section id="la-newsletter-linfolettre-est-morte-vive-linfolettre" class="level1">
<h1><del>La newsletter</del> L’infolettre est morte, vive l’infolettre !</h1>
<p>À l’occasion de cette <strong>dix-neuvième infolettre</strong>, on a discuté, réfléchi et pensé au sens de la vie. On a décidé de revoir le schéma de l’infolettre selon plusieurs critères :</p>
<ul>
<li>une périodicité mensuelle “garantie”, quitte à avoir des infolettres moins denses que d’autres ;</li>
<li>simplifier la rédaction et le contenu ;</li>
<li>continuer de parler à toutes les personnes intéressées par la science des données, quel que soit son niveau d’expertise ;</li>
<li>contribuer à mettre en avant plus facilement des personnes ou des projets au sein du réseau.</li>
</ul>
<p>Nouvelle structure, moins longue, plus ramassée, vous aurez plus de travail pour creuser plus loin les sujets ! L’idée est ainsi d’insérer au moins dans chaque veille :</p>
<ul>
<li>une datavisualisation</li>
<li>les actualités du réseau et une veille</li>
<li>une interview de quelqu’un ou d’une équipe selon un canevas à peu près stable.</li>
</ul>
<p>Bonne lecture 📔 !</p>
</section>
<section id="la-datavisualisation" class="level1">
<h1>La datavisualisation</h1>
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_19/measles-cases-historical-us-states-heatmap.png" class="img-fluid"></p>
<p>Une version interactive est disponible sur le site du <a href="https://graphics.wsj.com/infectious-diseases-and-vaccines/">Wall Street Journal</a>.</p>
</section>
<section id="actus-du-réseau" class="level1">
<h1>Actus du réseau</h1>
<section id="la-troisième-journée-du-réseau-1-décembre---la-tréso-malakoff" class="level2">
<h2 class="anchored" data-anchor-id="la-troisième-journée-du-réseau-1-décembre---la-tréso-malakoff">La troisième journée du réseau 📅 1 décembre - La Tréso (Malakoff)</h2>
<p><strong>Réservez votre 1<sup>er</sup> décembre !</strong> Pour la troisième année consécutive, le SSPLab organise la journée du réseau pour rassembler les data-scientists de la statistique publique. Au menu : présentation de projets innovants, retour d’expérience et moments d’échanges informels (autrement appelés “pots” 🎉).</p>
<p>Comme les années précédentes, l’événement sera en présentiel et à distance pour permettre à tous de participer. Les détails seront publiés sur le <a href="../../talk/2025-12-01-network-day/index.html">site du réseau</a> et si jamais vous voulez déjà vous inscrire alors que l’agenda n’est pas finalisé, c’est possible <a href="https://www.eventbrite.com/e/billets-3e-journee-du-reseau-des-data-scientists-1664052518879?aff=oddtdtcreator">ici</a>.</p>
<ul>
<li>👉️ <a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2025-12-network/2025_12_3ejournee_SSPHub.ics">Ajouter cet événement à votre agenda <code>Outlook</code></a></li>
</ul>
</section>
<section id="le-site-du-réseau-évolue" class="level2">
<h2 class="anchored" data-anchor-id="le-site-du-réseau-évolue">Le site du réseau évolue</h2>
<p><strong>L’inscription</strong> à la liste de diffusion a été revue et utilise maintenant <a href="https://lasuite.numerique.gouv.fr/produits/grist">Grist</a>. Pour s’inscrire à la liste de diffusion, c’est par <a href="https://grist.numerique.gouv.fr/o/ssphub/forms/jSjAV3L2F8mmiRVuVEpfF7/103">ici</a>. Une fois inscrit, vous pouvez créer un compte sur <a href="https://grist.numerique.gouv.fr">Grist</a> et vous connecter directement sur <a href="https://grist.numerique.gouv.fr/o/ssphub/iTFX7gryL8jK/Annuaire?utm_id=share-doc">l’annuaire</a> pour mettre à jour vos données, demander votre désinscription en cochant la case “Supprimez mon compte”.</p>
<p>Par ailleurs, le <strong>site du réseau devrait évoluer dans les prochaines semaines</strong>. Il va s’étoffer pour présenter plus de projets en cours et permettre ainsi à tout un chacun de savoir qu’un projet existe et pouvoir échanger entre pairs. Si vous souhaitez valoriser un projet, n’hésitez pas à nous le faire savoir !</p>
</section>
</section>
<section id="actualités" class="level1">
<h1>Actualités</h1>
<p>Voici une liste de sujets d’actualité depuis cet été jugés subjectivement intéressants.</p>
<section id="ia" class="level2">
<h2 class="anchored" data-anchor-id="ia">IA</h2>
<p>Comme toujours, une flopée d’articles a été publiée sur l’IA : le nouveau modèle d’OpenAI (GPT-5) a été déployé cet été, l’usage de l’IA se développe, des craintes se font entendre sur l’existence d’une bulle financière et, avec l’augmentation de son utilisation, de plus en plus de failles de sécurité liées sont découvertes. Un petit florilège rapide, <strong>non exhaustif</strong> :</p>
<ul>
<li><p>En France, <strong>l’IA est de plus en plus utilisée par les entreprises</strong> d’après une <a href="https://www.insee.fr/fr/statistiques/8604126#:~:text=En%202024%2C%2010%20%25%20des%20entreprises%20fran%C3%A7aises%20de%2010%20salari%C3%A9s%20ou,quelle%20que%20soit%20leur%20taille">étude de l’Insee</a>. En 2024 ainsi, une entreprise sur dix utilise l’IA, et ce phénomène concerne particulièrement 33% des grandes entreprises et 42% de celles de l’information. L’usage de l’IA augmente de 4 points par rapport à 2023. L’IA est par ailleurs légèrement moins utilisée par les entreprises en France que dans l’Europe, où 13% des entreprises disent utiliser l’IA en 2024.</p></li>
<li><p>Sur l’<strong>impact de l’IA</strong>, notamment sur le travail et la productivité, de nombreuses études continuent d’être publiées. Petit disclaimer, la technologie évolue encore très vite : depuis son arrivée il y a moins de trois ans, les bugs relevés au début ne sont plus du tout d’actualité aujourd’hui : les images sont de bien meilleure qualité, des RAG ont été mis en place … Face à un domaine aussi changeant, les résultats des études varient donc encore beaucoup.</p>
<ul>
<li>Ceci étant dit, les études montrent globalement que l’IA permettrait d’améliorer l’efficacité des travailleurs, particulièrement des <strong>non-experts</strong>, et réduit les <strong>inégalités de performance</strong>, même si les résultats sont contrastés. Selon <a href="https://digitaleconomy.stanford.edu/publications/canaries-in-the-coal-mine/">cette étude</a>, l’IA commence à avoir un impact négatif sur l’emploi, quand <a href="https://arxiv.org/abs/2507.09089">celle-ci</a> estime à l’inverse que les gains de productivité pour les développeurs sont sur-estimés.</li>
<li>L’usage de l’IA serait particulièrement efficace pour effectuer des <strong>tâches moyennement rares</strong>, l’humain restant plus efficace sur les tâches courantes (<em>cf.</em> par exemple <a href="https://www.nber.org/papers/w31161">ce papier</a>). Par ailleurs, sur les tâches complexes ou rares, l’IA serait largement moins efficace que l’humain et produirait des résultats de qualité moindre (<em>cf.</em> ce <a href="https://www.hbs.edu/ris/Publication%20Files/24-013_d9b45b68-9e74-42d6-a1c6-c72fb70c7282.pdf">papier</a>).</li>
</ul></li>
<li><p>Concernant la <strong>technologie en soit</strong>, des chercheurs ont réussi, à partir d’un petit modèle d’IA générative, à classifier du texte aussi efficacement qu’avec un gros modèle et nécessitant bien moins de données. Pour ce faire, ils ont utilisé un modèle de régression pénalisée (type Lasso/Ridge) sur la représentation numérique sous-jacente du texte. Plus de détails dans <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5303840">leur article</a>.</p></li>
<li><p>De nombreux articles font craindre l’existence d’une <strong>bulle financière autour de l’IA</strong>.</p>
<ul>
<li>Edward Zitron, un publiciste britannique, auteur et podcasteur, rappelle sur <a href="https://www.wheresyoured.at/the-haters-gui/">son blog</a> toutes les raisons pour laquelle une bulle existerait actuellement sur l’IA. Il rappelle notamment que les 560Md$ investis par les GAFAM dans l’IA n’ont généré que très peu de bénéfices et que le seul gagnant est Nvidia. Comme le dit le proverbe, <strong>“Pendant la ruée vers l’or, ce ne sont pas les chercheurs d’or qui se sont le plus enrichis, mais les vendeurs de pelles et de pioches”</strong>.</li>
<li>L’adoption de l’IA par les entreprises prendrait par ailleurs <strong>plus de temps qu’anticipé</strong> et n’aurait pas des rendements aussi rapides qu’espéré.</li>
<li>Plus généralement, des articles, comme cet article de <a href="https://www.forbes.com/sites/paulocarvao/2025/08/21/is-the-ai-bubble-bursting-lessons-from-the-dot-com-era/">Forbes</a>, rappellent que l’IA reste très utilisée aujourd’hui et que, même si aujourd’hui des investissements sont fait vers des projets peu productifs, <strong>l’adoption de nouvelles technologies prend du temps</strong>. Les articles citent beaucoup l’exemple d’internet, et de la bulle du début des années 2000 : les attentes du marché étaient trop hautes par rapport à tout le travail qu’il restait à faire, et cela n’empêche pas que aujourd’hui, 25 ans après cette bulle, les investissements dans le réseau internet ont permis de changer la société.</li>
</ul></li>
<li><p>Enfin, avec l’augmentation de son utilisation, la <strong>sécurité</strong> de la technologie est un enjeu qui est de plus en plus discuté, au-delà du <strong>détournement à des fins illégales</strong> qui attend toute innovation numérique :</p>
<ul>
<li>Des <strong>données confidentielles de Microsoft</strong> ont fuité après le piratage d’agents Copilot. Les <a href="https://x.com/mbrg0/status/1953815729947447770/photo/1">hackeurs</a> ont ainsi reçu par mail des extraits des contacts et des ventes de Microsoft.</li>
<li>Selon le <a href="https://www-cdn.anthropic.com/b2a76c6f6992465c09a6f2fce282f6c0cea8c200.pdf">rapport d’Anthropic</a> sur les menaces liées à l’IA, cette technologie a notamment été détournée pour :
<ul>
<li>s’assurer des postes bien payés pour des <strong>Nord-Coréens</strong>, qui leur ont permis de rapatrier les capitaux au pays ;</li>
<li>massifier les <strong>fraudes aux données personnelles</strong> ;</li>
<li><strong>automatiser les attaques par ransomware</strong>.</li>
</ul></li>
</ul></li>
</ul>
</section>
<section id="parquet" class="level2">
<h2 class="anchored" data-anchor-id="parquet">Parquet</h2>
<ul>
<li>Le site <a href="https://hyperparam.app/">Hyperparam</a> permet <strong>d’afficher très rapidement des données Parquet volumineuses</strong> sur son explorateur web très rapidement (en moins de 500ms). Pour la tuyauterie, tout est expliqué <a href="https://blog.hyperparam.app/2025/07/24/quest-for-instant-data/">sur ce blog</a>.</li>
</ul>
</section>
<section id="kubernetes" class="level2">
<h2 class="anchored" data-anchor-id="kubernetes">Kubernetes</h2>
<ul>
<li><strong>Comment détecter facilement des pods Kubernetes peu actifs et les désactiver?</strong> Un début de processus a été publié sur <a href="https://blog.devops.dev/reclaiming-idle-gpus-in-kubernetes-a-practical-approach-and-a-call-for-ideas-08cbad89f988">Devops.dev</a>.</li>
</ul>
</section>
<section id="nouveautés" class="level2">
<h2 class="anchored" data-anchor-id="nouveautés">Nouveautés</h2>
<ul>
<li>Une <strong>nouvelle version des notebooks Observable</strong> est disponible en pré-production, avec un kit open source pour générer des notebooks et des sites statiques et une application pour Mac pour éditer ses notebooks en local, intégrant de manière plus fluide les apports de l’IA. Plus de détails par <a href="https://observablehq.com/notebook-kit/">ici</a> et une <a href="https://observablehq.com/notebook-kit/gallery">galerie</a> d’exemples de sites.</li>
<li>L’université allemande de Hanovre <a href="https://geovectors.l3s.uni-hannover.de/">a publié</a> une <strong>base d’embedding des entités d’Openstreetmap</strong> directement utilisable pour entraîner des modèles de machine learning.</li>
<li>Selon une <a href="https://posit.co/blog/python-llm-evaluation/">étude de Posit</a>, le <strong>meilleur modèle d’IA pour aider à coder en Python</strong> serait ceux d’OpenAI (o3-mini, o4-mini) ou d’Anthropic (Claude Sonnet 4).</li>
</ul>
</section>
<section id="fun" class="level2">
<h2 class="anchored" data-anchor-id="fun">Fun</h2>
<ul>
<li>Vous vous êtes déjà demandé comment résoudre un <a href="https://sutom.nocle.fr/">SUTOM</a> avec les <strong>dépendances de Python</strong> ? Non ? Et bien quelqu’un a trouvé le moyen de résoudre des Sudoku et des Motus grâce à cela ! Tout est expliqué <a href="https://mildbyte.xyz/blog/solving-wordle-with-uv-dependency-resolver/">ici</a></li>
<li>Avez-vous déjà vu une <strong>intelligence artificielle jouer au Loup-Garou</strong> ? Des étudiants de l’ENSAE <del>se sont amusés</del> ont <a href="https://werewolf.foaster.ai/">étudié</a> quelles IA étaient meilleures au jeu du Loup-Garou. Ce jeu nécessite en effet de mentir, de convaincre, et d’adapter sa stratégie pour survivre (pour les villageois) ou tuer tous les villageois (pour les loup-garous). A la fin, <strong>GPT-5 gagne dans 97 % des 60 matchs joués, contre 15% pour GPT-OSS-120b</strong>.</li>
</ul>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Astuce
</div>
</div>
<div class="callout-body-container callout-body">
<p>Vous voyez d’autres sujets d’actualité intéressants ? N’hésitez pas à les partager sur le <a href="https://tchap.gouv.fr/#/room/#ssphub:agent.finances.tchap.gouv.fr">groupe Tchap 💬</a> directement !</p>
</div>
</div>
</section>
</section>
<section id="linterview" class="level1">
<h1>L’interview</h1>
<p>Première interview, je propose donc humblement de m’auto-interviewer pour lancer ce format et de comparer les questions que j’ai trouvées avec celles proposées par une IA.</p>
<section id="première-interview-avec-nicolas-qui-travaille-à-linsee-ssplab" class="level2">
<h2 class="anchored" data-anchor-id="première-interview-avec-nicolas-qui-travaille-à-linsee-ssplab">Première interview avec Nicolas, qui travaille à l’Insee (SSPLab)</h2>
<table class="caption-top table">
<tbody>
<tr class="odd">
<td><strong>Peux-tu te présenter?</strong></td>
<td>De formation ingénieur, j’ai <strong>travaillé huit ans dans l’administration publique</strong> avec un parcours que certains ont dit plutôt atypique (ce n’est pas totalement mon avis 🙃). J’ai notamment travaillé au sein de la DG Trésor et à la Commission européenne, sur des sujets de prévision de finances publiques, de négociations européennes et de suivi de la Banque centrale européenne. Le traitement de la donnée n’a pas été jusque-là au centre de mes postes mais l’importance des outils et de traitement plus robuste aurait facilité la vie à certains moments. J’arrive donc à l’<strong>Insee pour la première fois</strong> mais je suis content de “découvrir la maison”. <br> A l’Insee, je travaille au sein du SSPLab, le laboratoire de l’innovation en data sciences de l’Insee. L’équipe est chargée de faire de la veille et d’épauler les équipes métiers dans leurs projets. J’ai tout particulièrement l’honneur de succéder à Lino au poste d’<strong>animateur du SSPHub</strong>, big up à lui pour tout ce qu’il a fait ces trois dernières années !</td>
</tr>
<tr class="even">
<td><strong>Peux-tu donner un conseil que tu aurais aimé recevoir en lien avec la data ?</strong></td>
<td>Question difficile, étant donné que je n’ai pas mené <del>beaucoup</del> de projets data jusqu’ici. Mais j’ai remarqué que <strong>l’ordinateur avait rarement tort</strong>, ce qui est assez frustrant, et qu’être persévérant était nécessaire. Avoir un code propre aussi, quand on n’est même pas capable de comprendre ce qu’on a codé soi-même en rentrant de vacances, cela donne une leçon pour la suite. J’aurai sûrement plus d’exemples d’ici un an ou deux 😉</td>
</tr>
<tr class="odd">
<td><strong>As-tu un projet qui a particulièrement marché, et pourquoi a-t-il marché ? A l’inverse, as-tu un projet qui n’a pas marché et pourquoi ?</strong></td>
<td>J’avais codé des petits programmes pour m’aider dans mon travail quotidien, sans rapport direct avec la donnée. Ce qui a aidé dans les deux cas c’est que <strong>le besoin métier était bien défini et bien compris</strong>, puisque j’étais à la fois le métier et le développeur. Cependant, ces programmes faisaient partie d’un shadow IT qui n’a pas dû me survivre bien longtemps. J’ai quand même réussi à pousser un programme qui faisait du publipostage jusqu’à sa mise en production. À ma surprise, c’est la phase de déploiement qui a été bien plus longue que la phase de développement : cela a dû me prendre quelques jours de code contre plusieurs semaines avant le déploiement.</td>
</tr>
<tr class="even">
<td><strong>Dans quel domaine le service public pourrait être aidé par une utilisation plus importante des données ?</strong></td>
<td>Un usage plus important de la donnée serait fort bénéfique pour la simplification des démarches pour les citoyens, permettre de diminuer le non-recours aux subventions et différents dispositifs publics tout en renforçant la qualité des données échangées entre administrations.</td>
</tr>
<tr class="odd">
<td><strong>La dernière découverte technologique qui t’a marqué</strong></td>
<td>J’avais un peu laissé de côté <strong>R Markdown</strong> depuis huit ans. En revenant dans le domaine de la data, je découvre à quel point ce milieu a évolué grâce à <strong>Posit, Quarto et l’apport de tous ces projets open source</strong>, auxquels des gens contribuent souvent naturellement. L’open source, c’est un peu comme les pompiers ou le secours en mer : ce sont des bénévoles qui font tenir et maintiennent des outils extraordinaires. Et plus récemment encore avec ma prise de poste à l’Insee, la découverte d’<a href="https://onyxia.sh/">Onyxia</a>, de <code>duckDB</code> et de <code>Parquet</code> m’ont aussi marqués.</td>
</tr>
</tbody>
</table>
</section>
<section id="linterview-à-laquelle-vous-avez-échappé" class="level2">
<h2 class="anchored" data-anchor-id="linterview-à-laquelle-vous-avez-échappé">L’interview à laquelle vous avez échappé</h2>
<p>Quelle est la plus-value de l’IA par rapport à un travail humain ? J’ai comparé les questions que j’avais trouvées avec des idées produites par une IA. Voici les questions qu’il m’a proposées, que j’ai proposé de ne pas suivre. Remarquez, ces questions sont le résultat de deux ou trois échanges avec l’IA, je n’y ai pas passé beaucoup plus de temps.</p>
<blockquote class="blockquote">
<p>Voici une proposition de questions adaptées à des data scientists ou des managers de data scientists travaillant dans l’administration publique :</p>
<ol type="1">
<li><p><strong>Formations et influences</strong> <em>“Quelle formation ou influence majeure a façonné votre approche des données et de la gestion dans l’administration ?”</em></p></li>
<li><p><strong>Expériences professionnelles</strong> <em>“Quelles ont été les étapes clés de votre carrière dans l’administration qui ont influencé votre façon de gérer ou d’analyser les données ?”</em></p></li>
<li><p><strong>Motivations et passions</strong> <em>“Qu’est-ce qui vous motive le plus dans l’analyse ou la gestion des données au sein de l’administration publique ?”</em></p></li>
<li><p><strong>Réalisations majeures</strong> <em>“Quels sont vos principaux accomplissements en matière de gestion ou d’analyse de données dans votre rôle actuel ?”</em></p></li>
<li><p><strong>Développement personnel</strong> <em>“Quels défis spécifiques aux données avez-vous rencontrés dans le secteur public et comment les avez-vous surmontés ?”</em></p></li>
<li><p><strong>Projets actuels</strong> <em>“Sur quels projets liés aux données travaillez-vous actuellement, et qu’est-ce qui les rend particulièrement intéressants ou innovants ?”</em></p></li>
<li><p><strong>Regrets ou aspirations</strong> <em>“Y a-t-il des projets ou réalisations en lien avec les données que vous auriez aimé accomplir dans votre carrière mais qui ne se sont pas concrétisés ?”</em></p></li>
<li><p><strong>Vision future</strong> <em>“Comment voyez-vous l’évolution de l’importance des données dans l’administration publique dans les années à venir, et quel rôle aimeriez-vous y jouer ?”</em></p></li>
<li><p><strong>Conseils aux jeunes générations</strong> <em>“Quel conseil donneriez-vous à un jeune professionnel qui souhaite devenir data scientist ou manager de data scientists dans le secteur public ?”</em></p></li>
<li><p><strong>Philosophie personnelle</strong> <em>“Si vous deviez partager une philosophie ou un credo concernant la gestion ou l’analyse des données dans l’administration, quelle serait-elle ?”</em></p></li>
</ol>
<p>Ces questions devraient aider à explorer les nuances spécifiques du travail des data scientists et de leurs managers dans le secteur public. Si vous souhaitez ajuster davantage ou ajouter des thèmes spécifiques, n’hésitez pas à me le faire savoir !</p>
</blockquote>


</section>
</section>

 ]]></description>
  <category>Infolettre</category>
  <guid>https://ssphub.netlify.app/infolettre/infolettre_19/</guid>
  <pubDate>Mon, 29 Sep 2025 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/infolettre/infolettre_19/2025_09_back_school.png" medium="image" type="image/png" height="107" width="144"/>
</item>
<item>
  <title>Atelier - Comment récupérer des données sous format Parquet ?</title>
  <link>https://ssphub.netlify.app/talk/2025-04-16-Parquet/</link>
  <description><![CDATA[ 





<p>L’atelier a eu lieu le <strong>16 avril 2025 (15h - 16h30)</strong>, en présentiel à l’Insee et en distanciel pour les membres du réseau du SSP Hub. Environ 35 personnes ont participé de l’Insee (DG ou directions régionales), de différents services statistiques ministériels ou d’autres horizons. Merci à tous pour les échanges !</p>
<section id="slides-de-la-présentation" class="level1">
<h1>Slides de la présentation</h1>
<div>
<iframe class="slide-deck" style="width: 100%; height: 500px" src="https://inseefrlab.github.io/ssphub-ateliers-slides/slides-data/parquet#/title-slide"></iframe>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="26" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 25;"><span id="cb1-26"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides_button<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="expression">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="32" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 31;"><span id="cb2-32">slides_button <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;p class="text-center"&gt;</span></span>
<span id="cb2-33"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;a class="btn btn-primary btn-lg cv-download" href="https://inseefrlab.github.io/ssphub-ateliers-slides/slides-data/parquet#/title-slide" target="_blank"&gt;</span></span>
<span id="cb2-34"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;i class="fa-solid fa-file-arrow-down"&gt;&lt;/i&gt;&amp;ensp;Voir les slides</span></span>
<span id="cb2-35"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;/a&gt;</span></span>
<span id="cb2-36"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/p&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="declaration">

</div>
</div>
</div>
</section>
<section id="documentation-de-latelier-replay" class="level1">
<h1>Documentation de l’atelier &amp; <em>replay</em></h1>
<p>Le matériel lié à l’atelier, y compris le replay, est disponible <a href="https://ssphub.github.io/ssphub-ateliers-parquet/" target="_blank">ici</a>. <img src="https://ssphub.netlify.app/talk/2025-04-16-Parquet/Parquet-site-preview.png" class="img-fluid"></p>
</section>
<section id="questions-contact" class="level1">
<h1>Questions / contact</h1>
<p>Si vous avez la moindre question 🤨, n’hésitez pas à contacter 📧 <em><a href="mailto:ssphub-contact@insee.fr" class="email">ssphub-contact@insee.fr</a></em>.</p>


</section>

 ]]></description>
  <category>Parquet</category>
  <category>event</category>
  <guid>https://ssphub.netlify.app/talk/2025-04-16-Parquet/</guid>
  <pubDate>Wed, 16 Apr 2025 14:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/talk/2025-04-16-Parquet/Atelier-Parquet.png" medium="image" type="image/png" height="144" width="144"/>
</item>
<item>
  <title>Atelier - Comment récupérer des données par API ?</title>
  <link>https://ssphub.netlify.app/talk/2025-04-09-API/</link>
  <description><![CDATA[ 





<p>L’atelier a eu lieu le <strong>9 avril 2025 (15h - 16h30)</strong>, en présentiel à l’Insee et en distanciel pour les membres du réseau du SSP Hub. Environ 35 personnes ont participé de l’Insee (DG ou directions régionales), de différents services statistiques ministériels ou d’autres horizons. Merci à tous pour les échanges !</p>
<section id="slides-de-la-présentation" class="level1">
<h1>Slides de la présentation</h1>
<div>
<iframe class="slide-deck" style="width: 100%; height: 500px" src="https://inseefrlab.github.io/ssphub-ateliers-slides/slides-data/api.html#/title-slide/"></iframe>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="26" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 25;"><span id="cb1-26"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides_button<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="expression">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="32" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 31;"><span id="cb2-32">slides_button <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;p class="text-center"&gt;</span></span>
<span id="cb2-33"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;a class="btn btn-primary btn-lg cv-download" href="https://inseefrlab.github.io/ssphub-ateliers-slides/slides-data/api.html#/title-slide" target="_blank"&gt;</span></span>
<span id="cb2-34"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;i class="fa-solid fa-file-arrow-down"&gt;&lt;/i&gt;&amp;ensp;Voir les slides</span></span>
<span id="cb2-35"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;/a&gt;</span></span>
<span id="cb2-36"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/p&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="declaration">

</div>
</div>
</div>
</section>
<section id="documentation-de-latelier-replay" class="level1">
<h1>Documentation de l’atelier &amp; <em>replay</em></h1>
<p>Le matériel lié à l’atelier, y compris le replay, est disponible <a href="https://inseefrlab.github.io/ssphub-ateliers/sessions/api.html" target="_blank">ici</a>. <img src="https://ssphub.netlify.app/talk/2025-04-09-API/API-site-preview.png" class="img-fluid"></p>
</section>
<section id="questions-contact" class="level1">
<h1>Questions / contact</h1>
<p>Si vous avez la moindre question 🤨, n’hésitez pas à contacter 📧 <em><a href="mailto:ssphub-contact@insee.fr" class="email">ssphub-contact@insee.fr</a></em>.</p>


</section>

 ]]></description>
  <category>API</category>
  <category>event</category>
  <guid>https://ssphub.netlify.app/talk/2025-04-09-API/</guid>
  <pubDate>Wed, 09 Apr 2025 14:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/talk/2025-04-09-API/Atelier-API.png" medium="image" type="image/png" height="108" width="144"/>
</item>
<item>
  <title>Deuxième journée du SSPHub</title>
  <link>https://ssphub.netlify.app/talk/2024-10-14-network-day/</link>
  <description><![CDATA[ 





<section id="replay-de-la-deuxième-journée-du-ssphub-le-14-octobre-2024" class="level2">
<h2 class="anchored" data-anchor-id="replay-de-la-deuxième-journée-du-ssphub-le-14-octobre-2024">Replay de la deuxième journée du SSPHub le 14 octobre 2024</h2>
<p>Les sessions plénières de la journée du réseau sont disponibles ci-dessous:</p>
<details>
<summary>
Séquencement de la vidéo et <em>slides</em>
</summary>
<ul>
<li><p><strong>00:00-03:30</strong>: Introduction de la journée par Romain Lesur</p></li>
<li><p><strong>03:30-46:30</strong>: <em>“Le blé vu du ciel : images satellitaires et prédiction des rendements agricoles à l’échelle de la parcelle”</em> (Service statistique ministériel du Ministère de l’Agriculture, de la souveraineté alimentaire et de la Forêt).</p></li>
</ul>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="33" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 32;"><span id="cb1-33"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb1-34">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/agriculture.pdf"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-35">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides du SSM Agriculture"</span></span>
<span id="cb1-36">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="expression">

</div>
</div>
</div>
<ul>
<li><strong>46:30-83:00</strong>: <em>“Identifier et classer les causes de décès en automatisant le traitement des certificats en langage naturel”</em> (CépiDC, Inserm)</li>
</ul>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="42" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 41;"><span id="cb2-42"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb2-43">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/cepidc.pdf"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-44">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides du CépiDC"</span></span>
<span id="cb2-45">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="expression">

</div>
</div>
</div>
<ul>
<li><p><strong>86:00-123:00</strong>: <em>Keynote</em> de Pascal Rivière (chef de l’Inspection générale de l’Insee) <em>“Data science et statistique publique : contexte institutionnel et évolutions”</em></p></li>
<li><p><strong>123:00-164:00</strong>: <em>“Extraction automatisée de tableaux dans des PDF pour la construction de statistiques d’entreprises”</em> (Insee)</p></li>
</ul>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb3" data-startfrom="53" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 52;"><span id="cb3-53"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb3-54">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://ssplab.pages.lab.sspcloud.fr/table-extraction-evaluation/#/title-slide"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb3-55">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Voir les slides de l'Insee"</span></span>
<span id="cb3-56">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-3" data-nodetype="expression">

</div>
</div>
</div>
<ul>
<li><strong>164:00-205:00</strong>: <em>“Scraper et retravailler les offres d’emploi en ligne pour permettre des analyses fines du marché du travail, le projet JOCAS”</em> (Dares: Service statistique ministériel du Ministère du Travail et de l’Emploi)</li>
</ul>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb4" data-startfrom="62" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 61;"><span id="cb4-62"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb4-63">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/jocas.pptx"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb4-64">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides de la DARES"</span></span>
<span id="cb4-65">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-4" data-nodetype="expression">

</div>
</div>
</div>
<ul>
<li><strong>A partir de 205:00</strong>: <em>Keynote</em> de Pierre Etienne Devineau (ex-DINUM) sur les enjeux rencontrés par le projet Albert autour de l’entraînement et de la mise en production de grands modèles de langage (LLM) francophones.</li>
</ul>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb5" data-startfrom="71" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 70;"><span id="cb5-71"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(</span>
<span id="cb5-72">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/albert.pptx"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb5-73">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides de la keynote"</span></span>
<span id="cb5-74">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-5" data-nodetype="expression">

</div>
</div>
</div>
</details>
<p>Quelques photos de l’événement:</p>
<div class="quarto-video"><video id="video_shortcode_videojs_video1" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/GMT20241014-080309_Recording_3840x2160.mp4"></video></div>
<div id="fig-ssphub-images" class="quarto-layout-panel">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-ssphub-images-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: center;">
<p><a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img1.jpg" class="lightbox" data-gallery="my-gallery" title="Figure&nbsp;1: "><img src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img1.jpg" class="img-fluid figure-img"></a></p>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: center;">
<p><a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img2.jpg" class="lightbox" data-gallery="my-gallery" title="Figure&nbsp;1: "><img src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img2.jpg" class="img-fluid figure-img"></a></p>
</div>
</div>
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: center;">
<p><a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img3.jpg" class="lightbox" data-gallery="my-gallery" title="Figure&nbsp;1: "><img src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img3.jpg" class="img-fluid figure-img"></a></p>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: center;">
<p><a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img4.jpg" class="lightbox" data-gallery="my-gallery" title="Figure&nbsp;1: "><img src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img4.jpg" class="img-fluid figure-img"></a></p>
</div>
</div>
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: center;">
<p><a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img5.jpg" class="lightbox" data-gallery="my-gallery" title="Figure&nbsp;1: "><img src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img5.jpg" class="img-fluid figure-img"></a></p>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: center;">
<p><a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img6.jpg" class="lightbox" data-gallery="my-gallery" title="Figure&nbsp;1: "><img src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img6.jpg" class="img-fluid figure-img"></a></p>
</div>
</div>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-ssphub-images-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: <a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img7.jpg" class="lightbox" data-gallery="my-gallery" title="Figure&nbsp;1: "><img src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-10-14-network/img7.jpg" class="img-fluid figure-img"></a>
</figcaption>
</figure>
</div>
<p>Les <em>slides</em> des différentes présentations peuvent être téléchargées ⬆️</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb6" data-startfrom="107" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 106;"><span id="cb6-107"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">createButton</span>(slides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> message<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Télécharger les slides"</span>){</span>
<span id="cb6-108">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> button <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb6-109"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;p class="text-center"&gt;</span></span>
<span id="cb6-110"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;a class="btn btn-primary btn-lg cv-download" href="</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" target="_blank"&gt;</span></span>
<span id="cb6-111"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">      &lt;i class="fa-solid fa-file-arrow-down"&gt;&lt;/i&gt;&amp;ensp;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>message<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb6-112"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;/a&gt;</span></span>
<span id="cb6-113"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;/p&gt;`</span></span>
<span id="cb6-114">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> button</span>
<span id="cb6-115">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-6" data-nodetype="declaration">

</div>
</div>
</div>
<details>
<summary>
Rappel du programme de la journée
</summary>
<ul>
<li><strong>9h30-10h</strong>: <strong>Accueil</strong>, moment de convivialité autour d’un café.</li>
<li><strong>10h-11h30</strong>: <strong>Retours d’expérience</strong> de projets innovants autour de la classification de textes ou d’images :
<ul>
<li>Le blé vu du ciel : images satellitaires et prédiction des rendements agricoles à l’échelle de la parcelle (SSM Agriculture) ;</li>
<li>Identifier et classer les causes de décès en automatisant le traitement des certificats en langage naturel (CépiDC, Inserm).</li>
</ul></li>
<li><strong>11h30-12h15</strong>: <strong>Atelier de réflexion</strong> autour des applications des méthodes de classification de textes ou d’images sur les données des * participants.</li>
<li><strong>12h15-14h</strong>: <strong>Pause déjeuner</strong>, moment de convivialité.</li>
<li><strong>14h-14h30</strong>: Pascal Rivière (Chef de l’inspection générale de l’Insee) interviendra sur le thème <strong>“Data science et statistique publique : contexte institutionnel et évolutions”</strong>.</li>
<li><strong>14h30-16h</strong>: <strong>Retours d’expérience</strong> de projets faisant intervenir un processus innovant d’extraction de données :
<ul>
<li>Extraction automatisée de tableaux dans des PDF pour la construction de statistiques d’entreprises (Insee) ;</li>
<li>Scraper et retravailler les offres d’emploi en ligne pour permettre des analyses fines du marché du travail, le projet JOCAS (Dares, SSM Travail) ;</li>
</ul></li>
<li><strong>16h-16h30</strong>: <strong>Pause</strong>, moment de convivialité.</li>
<li><strong>16h30-17h30</strong>: <strong><em>Keynote</em></strong> par Pierre Etienne Devineau (Ministères sociaux) et Léo Guillaume (Dinum). Les enjeux rencontrés par le projet Albert autour de l’entraînement et de la mise en production de grands modèles de langage (LLM) francophones.</li>
<li><strong>17h30-19h30</strong>: <strong>Pot</strong>, moment de convivialité.</li>
</ul>
</details>
<p>Pour toute information : <a href="mailto:ssphub-contact@insee.fr" class="email">ssphub-contact@insee.fr</a></p>
<p>📺️ La première journée du réseau ayant eu lieu en 2023 est également <a href="../../talk/2023-ssphubday/index.html">disponible en replay</a>.</p>


</section>

 ]]></description>
  <category>dataviz</category>
  <category>event</category>
  <guid>https://ssphub.netlify.app/talk/2024-10-14-network-day/</guid>
  <pubDate>Mon, 14 Oct 2024 15:00:00 GMT</pubDate>
  <media:content url="https://custom-images.strikinglycdn.com/res/hrscywv4p/image/upload/c_limit,fl_lossy,h_1440,w_720,f_auto,q_auto/1934057/633539_443779.png" medium="image" type="image/png"/>
</item>
<item>
  <title>Quarto : Une évolution de R Markdown pour des travaux statistiques reproductibles</title>
  <link>https://ssphub.netlify.app/talk/2004-05-02-quarto/</link>
  <description><![CDATA[ 





<section id="christophe-dervieux-quarto-une-évolution-de-r-markdown-pour-des-travaux-statistiques-reproductibles" class="level2">
<h2 class="anchored" data-anchor-id="christophe-dervieux-quarto-une-évolution-de-r-markdown-pour-des-travaux-statistiques-reproductibles">Christophe Dervieux, "<code>Quarto</code> : Une évolution de <code>R Markdown</code> pour des travaux statistiques reproductibles"</h2>
<p><strong>2 mai (15h - 16h30)</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="29" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 28;"><span id="cb1-29"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides_button<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="expression">

</div>
</div>
</div>
<div class="quarto-video"><video id="video_shortcode_videojs_video1" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-05-02-quarto/dervieux_quarto_20240502.mp4"></video></div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="37" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 36;"><span id="cb2-37">slides <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://cderv.github.io/2024-quarto-evolution-rmd/#/title-slide"</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb3" data-startfrom="41" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 40;"><span id="cb3-41">slides_button <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;p class="text-center"&gt;</span></span>
<span id="cb3-42"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;a class="btn btn-primary btn-lg cv-download" href="</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" target="_blank"&gt;</span></span>
<span id="cb3-43"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;i class="fa-solid fa-file-arrow-down"&gt;&lt;/i&gt;&amp;ensp;Voir les slides</span></span>
<span id="cb3-44"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;/a&gt;</span></span>
<span id="cb3-45"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/p&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-3" data-nodetype="declaration">

</div>
</div>
</div>
<div>
<iframe class="slide-deck" style="width: 100%; height: 500px" src="https://cderv.github.io/2024-quarto-evolution-rmd/#/title-slide/"></iframe>
</div>


</section>

 ]]></description>
  <category>quarto</category>
  <category>event</category>
  <guid>https://ssphub.netlify.app/talk/2004-05-02-quarto/</guid>
  <pubDate>Thu, 02 May 2024 15:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/talk/2004-05-02-quarto/quarto.png" medium="image" type="image/png" height="53" width="144"/>
</item>
<item>
  <title>Sora, la nouvelle IA d’OpenIA pour générer des vidéos ; Le Chat, le nouveau modèle de Mistral ; Observable, pour s’abstraire des notebooks</title>
  <link>https://ssphub.netlify.app/infolettre/infolettre_18/</link>
  <description><![CDATA[ 





<p><img src="https://ssphub.netlify.app/infolettre/infolettre_18/infolettre18.png" class="img-fluid"></p>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Astuce
</div>
</div>
<div class="callout-body-container callout-body">
<p><strong><em>Vous désirez intégrer la liste de diffusion ? L’inscription se fait <a href="https://grist.numerique.gouv.fr/o/ssphub/forms/jSjAV3L2F8mmiRVuVEpfF7/103">ici</a>.</em></strong></p>
</div>
</div>
<p>Ce mois-ci, la première partie de la <em>newsletter</em> est consacrée à l’actualité dense dans le domaine des IA génératives et à l’annonce d’un nouveau générateur de site web pour les <em>data scientists</em>. Suivent les actualités du réseau, notamment une présentation de <code>Quarto</code> par Christophe Dervieux (Posit) et le replay de la présentation d’Eric Mauvière sur le sujet des bonnes pratiques de <em>dataviz</em>.</p>
<section id="sora-la-nouvelle-ia-dopenai-pour-générer-des-vidéos" class="level2">
<h2 class="anchored" data-anchor-id="sora-la-nouvelle-ia-dopenai-pour-générer-des-vidéos"><code>Sora</code>, la nouvelle IA d’OpenAI pour générer des vidéos</h2>
<p><br></p>
<p></p><div class="quarto-video"><video id="video_shortcode_videojs_video2" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://vp.nyt.com/video/2024/02/14/115628_1_15OPENAI-VIDEO-1_wg_720p.mp4"></video></div> <em>Source : <a href="https://www.nytimes.com/2024/02/15/technology/openai-sora-videos.html">New York Times</a> d’après OpenAI.</em><p></p>
<details>
<summary>
Instruction utilisée par OpenAI pour générer cette vidéo
</summary>
<em>“Animated scene features a close-up of a short fluffy monster kneeling beside a melting red candle. The art style is 3D and realistic, with a focus on lighting and texture. The mood of the painting is one of wonder and curiosity, as the monster gazes at the flame with wide eyes and open mouth. Its pose and expression convey a sense of innocence and playfulness, as if it is exploring the world around it for the first time. The use of warm colors and dramatic lighting further enhances the cozy atmosphere of the image.”</em>
</details>
<p><br></p>
<p>Après avoir révolutionné le champ de la génération d’image avec <code>DallE</code> (texte <img src="https://latex.codecogs.com/png.latex?%5Cto"> image), de la génération de textes avec <code>ChatGPT</code> (texte <img src="https://latex.codecogs.com/png.latex?%5Cto"> texte), OpenAI a rendu public les premières productions d’un modèle de génération de vidéos à partir d’instructions (texte <img src="https://latex.codecogs.com/png.latex?%5Cto"> vidéo). Ce produit, nommé <code>Sora</code>, génère des vidéos d’un réalisme qui n’avait encore jamais été atteint par les IA génératrices de vidéos. Jusqu’à présent, les modèles de ce type généraient des images dont les formes étaient grossières, la résolution d’une qualité faible et dont les mouvements étaient peu vraisemblables.</p>
<br>
<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;"> <iframe style="width:100%;height:100%;position:absolute;left:0px;top:0px;overflow:hidden" frameborder="0" type="text/html" src="https://www.dailymotion.com/embed/video/x8sw8om" width="100%" height="100%" allowfullscreen="" title="Dailymotion Video Player"> </iframe> </div>
<p><em>Source</em> : <a href="https://www.lemonde.fr/videos/video/2024/02/18/openai-devoile-sora-un-outil-qui-transforme-les-textes-en-videos-ultrarealistes_6217183_1669088.html">Le Monde</a></p>
<br>
<p><code>Sora</code> n’est pas directement mis à disposition du grand public, contrairement aux autres services d’OpenAI. Ce produit n’est partagé qu’à des utilisateurs identifiés par OpenAI comme pouvant représenter le public cible - des réalisateurs par exemple - ou ayant une expertise sur des sujets comme la désinformation, les biais, la connaissance des algorithmes de recommandation, etc. Cette diffusion restreinte vise à recevoir des retours de la part de potentiels clients ou d’experts sur les risques de ces technologies. La communication par le biais de quelques vidéos choisies par OpenAI permet, dans le même temps, de créer une attente du grand public avant la mise à disposition plus large.</p>
<p>Comme <code>Dall-E</code>, <code>Midjourney</code> et consorts qui généraient des mains avec <a href="https://www.newyorker.com/culture/rabbit-holes/the-uncanny-failures-of-ai-generated-hands">trop de doigts</a>, le réseau de neurones derrière <code>Sora</code> a encore des difficultés à respecter certaines règles élémentaires de vraisemblance. Par exemple, dans la vidéo ci-dessous, les événements liés à un bris de verre s’enchaînent dans un ordre incohérent.</p>
<p></p><div class="quarto-video"><video id="video_shortcode_videojs_video3" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://cdn.openai.com/tmp/s/discussion_0.mp4"></video></div> <em>Source : <a href="https://openai.com/research/video-generation-models-as-world-simulators">OpenAI</a></em><p></p>
<p>OpenAI a déjà prévu de <a href="https://openai.com/research/video-generation-models-as-world-simulators">nombreuses applications</a> à ce modèle. Outre la génération de vidéos à partir d’instructions verbales, <code>Sora</code> est capable d’animer une image, de compléter une vidéo déjà existante avec une vidéo fictionnelle, d’éditer une vidéo déjà existante pour changer des éléments… Les secteurs de la communication, de la création et de la diffusion de contenu sont concernés au premier chef mais la richesse des fonctionnalités possibles et la simplicité d’usage des produits d’OpenAI laissent penser que les applications iront bien au-delà de ces secteurs économiques ; la vidéo occupe maintenant une place prédominante sur internet et sur les réseaux sociaux pour de multiples usages.</p>
<p>Ce modèle soulève, comme <code>Dall-E</code> ou <code>ChatGPT</code> avant lui, des enjeux de propriété intellectuelle puisqu’il a aussi été entraîné sur des corpus massifs collectés depuis internet. Le réalisme des vidéos générées peut également laisser craindre, sans marque d’identification claire du fait que la vidéo est générée numériquement (principe du <a href="https://fr.wikipedia.org/wiki/Tatouage_num%C3%A9rique"><em>watermark</em></a>), des dérives autour de la mésinformation, notamment des vidéos malveillantes et réalistes de personnes dans des situations inventées (des <em>deepfakes</em>) ou la prolifération de contenus choquants si les garde-fous dans la génération de contenus sont outrepassés.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li>La <a href="https://openai.com/sora">présentation de <code>Sora</code></a> sur le site d’OpenAI ;</li>
<li>Un <a href="https://openai.com/research/video-generation-models-as-world-simulators">article</a> plus technique d’OpenAI sur les fonctionnalités de Sora ;</li>
<li>Les <a href="https://www.youtube.com/watch?v=HK6y8DAPN_0">10mn de vidéos de présentation</a> de <code>Sora</code> par OpenAI ;</li>
<li>Un <a href="https://www.nytimes.com/2024/02/15/technology/openai-sora-videos.html">article</a> du <em>New York Times</em> présentant <code>Sora</code></li>
<li>Un <a href="https://theconversation.com/openais-new-generative-tool-sora-could-revolutionize-marketing-and-content-creation-223806">article</a> sur le site <em>The Conversation</em> sur les enjeux pour certains secteurs économiques.</li>
</ul>
</div>
</div>
</section>
<section id="le-chat-un-concurrent-à-chatgpt-par-mistral-ai" class="level2">
<h2 class="anchored" data-anchor-id="le-chat-un-concurrent-à-chatgpt-par-mistral-ai">“<code>Le Chat</code>” : un concurrent à <code>ChatGPT</code> par Mistral AI 🐱</h2>
<p>Fin février, la <em>startup</em> française Mistral AI a rendu public, en accès libre, une IA conversationnelle aux fonctionnalités similaires à <code>ChatGPT</code> nommée <a href="https://mistral.ai/fr/news/le-chat-mistral/"><em>“Le Chat”</em></a>.</p>
<p>Ce service utilise le grand modèle de langage (LLM) <code>Mistral Large</code>, dernier né des LLM multilangues entraînés par Mistral AI. Contrairement à d’autres modèles de Mistral AI, celui-ci n’est pas ouvert ; l’accès n’y est possible que par le biais des services de Mistral ou par le biais du <em>cloud</em> Microsoft Azure, suite à un partenariat entre l’entreprise américaine et la startup française (tarification en fonction du volume de requêtes).</p>
<p>Selon les évaluations réalisées fin février, avant la sortie de Claude 3 (voir plus bas 👇️), ce modèle présentait des performances supérieures à celles des modèles <em>open source</em>, notamment <code>LLaMa-2</code>, sur une série d’évaluations de la véracité des réponses proposées par une IA et sur les capacités de raisonnement de celle-ci à partir de tests standardisés. Sur des questions d’un niveau de premier cycle universitaire (métrique MMLU proposée par <span class="citation" data-cites="hendrycks2021measuring">Hendrycks et al. (2021)</span>), Mistral Large propose la bonne réponse dans 81% des cas, ce qui l’amène presque au niveau de GPT-4 (86%) et bien au-dessus de Llama-2 (70%), le meilleur modèle <em>opensource</em> à l’heure actuelle.</p>
<details>
<summary>
Classement des principaux modèles de langage lors de la sortie de <code>Mistral Large</code>
</summary>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://mistral.ai/images/news/mistral-large/mistral-large-bar-plot.png" class="img-fluid figure-img"></p>
<figcaption>Performance des principaux LLM sur la métrique <a href="https://arxiv.org/abs/2009.03300">MMLU</a>, une série de 57 tests sur la fiabilité des réponses et les capacités de raisonnement des IA conversationnelles. Source : <a href="https://mistral.ai/fr/news/mistral-large/">Mistral AI</a>, fin février</figcaption>
</figure>
</div>
</details>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_18/MMLU_examples.png" class="img-fluid figure-img"></p>
<figcaption>Exemple de questions de niveau licence posées pour évaluer la qualité d’un modèle selon la métrique MMLU proposée par <span class="citation" data-cites="hendrycks2021measuring">Hendrycks et al. (2021)</span> (<a href="https://arxiv.org/abs/2009.03300">accéder à l’article de recherche</a>)</figcaption>
</figure>
</div>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><a href="https://chat.mistral.ai/chat">https://chat.mistral.ai/</a>, l’IA conversationnelle proposée par Mistral AI ;</li>
<li>Le <a href="https://mistral.ai/fr/news/mistral-large/"><em>post</em> de blog</a> par Mistral AI annonçant <code>Mistral Large</code> ;</li>
<li>La <a href="https://info.deeplearning.ai/mistral-living-large-googles-open-source-challenger-robot-chemist-schooling-language-models-in-math-1"><em>newsletter</em> d’Andrew Ng</a> consacrée à Mistral Large ;</li>
<li>L’<a href="https://arxiv.org/abs/2009.03300">article d’Hendrycks et al.&nbsp;(2021)</a> à l’origine de la métrique MMLU utilisée pour classer les modèles.</li>
</ul>
</div>
</div>
</section>
<section id="les-performances-de-gpt-4-dépassées-pour-la-première-fois" class="level2">
<h2 class="anchored" data-anchor-id="les-performances-de-gpt-4-dépassées-pour-la-première-fois">Les performances de GPT-4 dépassées pour la première fois</h2>
<p>Quelques jours seulement après la sortie de Mistral Large, un autre modèle de langage est venu concurrencer le modèle d’OpenAI GPT-4. Ce modèle nommé <code>Claude 3</code> est le premier à obtenir des performances supérieures à GPT-4 (le modèle derrière la version Pro de <code>ChatGPT</code>) sur les principaux tests de qualité des modèles. Ce modèle, créé par Anthropic et disponible en trois versions plus ou moins puissantes (<em>Haiku</em>, <em>Sonnet</em> et <em>Opus</em>), n’est pas encore disponible pour les utilisateurs résidant dans l’Union Européenne.</p>
<details>
<summary>
Les trois modèles <code>Claude-3</code> disponibles
</summary>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.anthropic.com/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F4zrzovbb%2Fwebsite%2F5d20371eeb8d045465bb22cacfd269b5958b004d-2200x1174.png&amp;w=3840&amp;q=75" class="img-fluid figure-img"></p>
<figcaption>Source : <a href="https://www.anthropic.com/news/claude-3-family">Anthropic</a></figcaption>
</figure>
</div>
</details>
<details>
<summary>
Comparaison des performances des LLM
</summary>
<img src="https://ssphub.netlify.app/infolettre/infolettre_18/eval_llm_generales.png" class="img-fluid" alt="Figure construite avec DataWrapper à partir des données fournies par Anthropic"> <img src="https://ssphub.netlify.app/infolettre/infolettre_18/eval_llm_math.png" class="img-fluid" alt="Figure construite avec DataWrapper à partir des données fournies par Anthropic">
</details>
<p>Les modèles <code>Claude</code> sont développés par l’entreprise Anthropic, créée par des anciens employés d’OpenAI considérant que la problématique de la <a href="https://fr.wikipedia.org/wiki/S%C3%BBret%C3%A9_des_intelligences_artificielles">sécurité des IA</a> n’était pas assez mise en avant par OpenAI. Valorisée autour de 18 milliards d’euros en ce début d’année 2024, elle a bénéficié de financements importants d’Amazon et de Google, ces deux entreprises ayant investi respectivement 4 et 2 milliards de dollars. Les modèles <code>Claude</code> sont disponibles pour les utilisateurs des <em>cloud</em> d’Amazon (AWS) ou de <em>Google</em> (GCP) à l’instar des modèles GPT disponibles aux utilisateurs du <em>cloud</em> de Microsoft (Azure). La concurrence entre OpenAI et Anthropic est ainsi l’occasion d’un affrontement entre les trois principaux acteurs du <em>cloud</em>. Au-delà de la concurrence entre leurs investisseurs, les modèles économiques d’Anthropic et d’OpenAI diffèrent. Anthropic vise plutôt à proposer des services à des entreprises accessibles par le biais d’API là où OpenAI propose plutôt des outils grands publics avec des fonctionnalités supplémentaires pour les acteurs spécialisés. Parmi les partenaires principaux d’Anthropic, on retrouve Gitlab, Quora ou Salesforce (l’éditeur de logiciel derrière Slack). A l’instar des modèles Mistral Large ou GPT-4, le modèle Claude 3 n’est pas <em>open source</em>.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li>L’<a href="https://www.anthropic.com/news/claude-3-family">annonce de Claude 3</a> par Anthropic ;</li>
<li>Un <a href="https://www.nytimes.com/2024/02/20/technology/anthropic-funding-ai.html">article</a> sur Anthropic par le <em>New York Times</em> et <a href="https://www.forbes.com/sites/alexkonrad/2024/03/04/anthropic-releases-claude-3-claims-beat-openai/">un autre</a> par Forbes.</li>
</ul>
</div>
</div>
</section>
<section id="observable-propose-un-constructeur-de-sites-statiques-pour-sabstraire-des-notebooks" class="level2">
<h2 class="anchored" data-anchor-id="observable-propose-un-constructeur-de-sites-statiques-pour-sabstraire-des-notebooks"><code>Observable</code> propose un constructeur de sites statiques, pour s’abstraire des <em>notebooks</em></h2>
<p>Afin de démocratiser l’utilisation de <code>Javascript</code> au-delà du cercle des développeurs <em>web</em>, Mike Bostock, ancien responsable des <em>dataviz</em> du <em>New York Times</em>, la référence en la matière, a créé il y a quelques années <code>Observable</code>.</p>
<p>En plus d’être une extension du langage <code>Javascript</code> à la grammaire familière aux connaisseurs de <code>Python</code> et <code>R</code>, <code>Observable</code> vise à créer une communauté d’utilisateurs de <code>Javascript</code> à l’interface entre <em>data scientists</em> et développeurs <em>web</em>. Pour cela, le site <a href="https://observablehq.com/">observablehq.com</a> se propose d’être un réseau social de <em>notebooks</em> en <code>Javascript</code>, un peu comme <code>Github</code> faisant office de réseau social du code. Les notebooks <em>Observable</em> permettent de rapidement prendre en main du code <code>Javascript</code> pour créer des analyses de données interactives qui peuvent ensuite être facilement partagées par le biais du site <a href="https://observablehq.com/">observablehq.com</a> pour simplifier les réutilisations du code proposé ou des données sous-jacentes.</p>
<p>Cependant, si les <em>notebooks</em> sont un terrain fertile pour l’expérimentation, ils montrent rapidement leurs limites dès qu’on désire s’abstraire de l’hébergement sur <a href="observablehq.com/">observablehq.com</a>. Pour mettre à disposition des visualisations interactives sur d’autres sites, les sites statiques sont plus simples d’usage. Historiquement, l’écosystème Javascript est construit autour d’imposants <em>frameworks</em> comme <a href="https://fr.legacy.reactjs.org/"><code>React</code></a>, bien connus des développeurs web mais méconnus des <em>data scientists</em> qui sont néanmoins amenés à livrer de plus en plus d’applications interactives pour valoriser des données.</p>
<p>L’annonce d’<a href="https://observablehq.com/blog/observable-2-0"><code>Observable Framework</code></a>, un constructeur de sites statiques, représente un changement d’approche. <code>Observable Framework</code> vise à être un <em>framework</em> permettant aux <em>data scientists</em> de construire des sites web en mélangeant des étapes de préparation de données en <code>R</code>, <code>Python</code> ou <code>SQL</code> (via <code>DuckDB</code>), du formattage de texte en <code>Markdown</code> et de l’interactivité grâce au langage <code>Observable</code>. L’approche est ainsi similaire à celle de <code>Quarto</code>, la référence pour les <em>data scientists</em> désirant construire des publications reproductibles (voir la section événements 👇️ pour en apprendre plus). Ce dernier écosystème permet déjà depuis quelques temps de compléter du travail de données en <code>R</code> ou <code>Python</code> avec des traitements en <code>Observable</code> pour obtenir un site web interactif sans besoin de solutions techniques complexes comme <code>Shiny</code> ou <code>Streamlit</code>.</p>
<p>Les évolutions à venir d’<code>Observable Framework</code> sont donc à surveiller, cet écosystème pouvant être amené, s’il rencontre du succès, à rentrer dans la boîte à outil standard des <em>data scientists</em> comme <code>Quarto</code> est déjà en train de le faire. Le site <a href="observablehq.com/">observablehq.com</a> ne va pas pour autant disparaître : celui-ci restera un lieu où on peut tirer avantage de la simplicité des <em>notebooks</em> pour l’expérimentation ou pour la mise à disposition de tutoriels pédagogiques. Ce virage est similaire à celui pris par <code>Python</code> dans la communauté des <em>data scientists</em> où les <em>notebooks</em>, après avoir connu une phase hégémonique, sont revenus à leur fonction initiale : des carnets pour expérimenter servant de brouillon avant l’écriture de scripts ou alors de belles pages, mêlant texte et code, pour présenter une démarche de manière pédagogique.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li>L’annonce d’<a href="https://observablehq.com/framework/"><code>Observable Framework</code></a> ;</li>
<li>L’<a href="https://quarto.org/docs/interactive/ojs/">interactivité dans <code>Quarto</code></a> grâce aux cellules <code>Observable</code> ;</li>
<li>Le <a href="https://ensae-reproductibilite.github.io/website/">cours de “Mise en production de projets data science”</a> de l’ENSAE où les enjeux techniques et humains de la mise à disposition de tels sites sont évoqués.</li>
</ul>
</div>
</div>
</section>
<section id="actus-du-réseau" class="level1">
<h1>Actus du réseau</h1>
<section id="chistophe-dervieux-quarto-une-évolution-de-r-markdown-pour-des-travaux-statistiques-reproductibles-2-mai" class="level2">
<h2 class="anchored" data-anchor-id="chistophe-dervieux-quarto-une-évolution-de-r-markdown-pour-des-travaux-statistiques-reproductibles-2-mai">Chistophe Dervieux, “<code>Quarto</code> : Une évolution de <code>R Markdown</code> pour des travaux statistiques reproductibles” (📅 <strong>2 mai</strong>)</h2>
<p>Pour fiabiliser la production de documents construits en valorisant des données (tableaux, graphiques, etc.), <em>RStudio</em> (devenu <em>Posit</em> depuis) a construit il y a quelques années l’écosystème <code>R Markdown</code> permettant de produire du document en mélangeant code et texte.</p>
<p>Cette problématique des publications reproductibles est devenue incontournable dans l’écosystème <code>R</code> et la solution <code>R Markdown</code> est dorénavant largement utilisée. Pour étendre les vertus de cette approche à d’autres langages, <em>Posit</em> a commencé à développer <code>Quarto</code>, un écosystème reprenant le principe de <code>R Markdown</code> mais étendant ces fonctionnalités à d’autres langages de programmation, notamment <code>Python</code> et <code>Observable</code>.</p>
<p>Le <strong>2 mai de 15h à 16h</strong>, Christophe Dervieux (<em>Posit</em>) nous présentera <code>Quarto</code>, l’écosystème de publications reproductibles qui succède à <code>R Markdown</code>. Cet événement est proposé de manière hybride : par le biais de <em>Zoom</em> ou, pour les agents en poste à la Direction Générale de l’Insee, en salle 4-C-458.</p>
<ul>
<li>👉️ <a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-05-02-quarto/quarto.ics">Ajouter cet événement à votre agenda <code>Outlook</code></a></li>
<li>👉️ <a href="https://insee-fr.zoom.us/j/94214258071?pwd=WlBSRVgvVHZ2TXJ1Ull0cWUzN0Npdz09">Lien zoom</a></li>
</ul>
</section>
<section id="vos-besoins-de-formation" class="level2">
<h2 class="anchored" data-anchor-id="vos-besoins-de-formation">Vos besoins de formation</h2>
<p>L’an dernier, nous avions organisé un questionnaire pour connaître les besoins de formations des membres du réseau. Ce questionnaire est utile pour que les événements organisés dans le cadre du réseau répondent au mieux aux besoins.</p>
<p>Afin de connaître les attentes et centres d’intérêt en cette année 2024, nous vous proposons un nouveau questionnaire. Celui-ci est également l’occasion d’accueillir vos retours sur les <em>masterclass</em> menées en 2023 en collaboration avec <em>Datascientest</em> si vous avez participé à celles-ci.</p>
<ul>
<li><a href="https://framaforms.org/besoin-de-formations-en-data-science-en-2024-1709718778">👉️ Questionnaire</a></li>
</ul>
</section>
<section id="replay-de-la-présentation-deric-mauvière-la-dataviz-pour-donner-du-sens-aux-données-et-communiquer-un-message" class="level2">
<h2 class="anchored" data-anchor-id="replay-de-la-présentation-deric-mauvière-la-dataviz-pour-donner-du-sens-aux-données-et-communiquer-un-message">Replay de la présentation d’Eric Mauvière “La dataviz pour donner du sens aux données et communiquer un message”</h2>
<p><img src="https://ssphub.netlify.app/talk/2024-02-29-mauviere/mauviere.png" class="img-fluid"></p>
<p>La présentation d’Eric Mauvière sur les bonnes pratiques de <em>dataviz</em> a rencontré un réel succès avec près de 150 participants. Le <em>replay</em> et les <em>slides</em> de cette présentation essentielle sont disponibles ci-dessous :</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="381" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 380;"><span id="cb1-381"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides_button<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="expression">

</div>
</div>
</div>
<div class="quarto-video"><video id="video_shortcode_videojs_video1" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-02-09-mauviere/20240229-mauviere-replay.mp4"></video></div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="390" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 389;"><span id="cb2-390">slides <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-02-09-mauviere/conf_ssphub_item7-1.pdf"</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb3" data-startfrom="395" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 394;"><span id="cb3-395">slides_button <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;p class="text-center"&gt;</span></span>
<span id="cb3-396"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;a class="btn btn-primary btn-lg cv-download" href="</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" target="_blank"&gt;</span></span>
<span id="cb3-397"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;i class="fa-solid fa-file-arrow-down"&gt;&lt;/i&gt;&amp;ensp;Télécharger les slides</span></span>
<span id="cb3-398"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;/a&gt;</span></span>
<span id="cb3-399"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/p&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-3" data-nodetype="declaration">

</div>
</div>
</div>



</section>
</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">Les références</h2><div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-hendrycks2021measuring" class="csl-entry">
Hendrycks, Dan, Collin Burns, Steven Basart, et al. 2021. <em>Measuring Massive Multitask Language Understanding</em>. <a href="https://arxiv.org/abs/2009.03300">https://arxiv.org/abs/2009.03300</a>.
</div>
</div></section></div> ]]></description>
  <category>Infolettre</category>
  <guid>https://ssphub.netlify.app/infolettre/infolettre_18/</guid>
  <pubDate>Thu, 07 Mar 2024 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/infolettre/infolettre_18/hitchcock_robot-1.webp" medium="image" type="image/webp"/>
</item>
<item>
  <title>Eric Mauvière, “La dataviz pour donner du sens aux données et communiquer un message”</title>
  <link>https://ssphub.netlify.app/talk/2024-02-29-mauviere/</link>
  <description><![CDATA[ 





<section id="eric-mauvière-la-dataviz-pour-donner-du-sens-aux-données-et-communiquer-un-message" class="level2">
<h2 class="anchored" data-anchor-id="eric-mauvière-la-dataviz-pour-donner-du-sens-aux-données-et-communiquer-un-message">Eric Mauvière, "La dataviz pour donner du sens aux données et communiquer un message"</h2>
<p><strong>29 février (15h - 16h)</strong></p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="20" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 19;"><span id="cb1-20"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides_button<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="expression">

</div>
</div>
</div>
<div class="quarto-video"><video id="video_shortcode_videojs_video1" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-02-09-mauviere/20240229-mauviere-replay.mp4"></video></div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="28" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 27;"><span id="cb2-28">slides <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-02-09-mauviere/conf_ssphub_item7-1.pdf"</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb3" data-startfrom="32" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 31;"><span id="cb3-32">slides_button <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;p class="text-center"&gt;</span></span>
<span id="cb3-33"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;a class="btn btn-primary btn-lg cv-download" href="</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>slides<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" target="_blank"&gt;</span></span>
<span id="cb3-34"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;i class="fa-solid fa-file-arrow-down"&gt;&lt;/i&gt;&amp;ensp;Télécharger les slides</span></span>
<span id="cb3-35"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;/a&gt;</span></span>
<span id="cb3-36"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/p&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-3" data-nodetype="declaration">

</div>
</div>
</div>
<p>Un exemple issu de la présentation d’Eric :</p>
<p><img src="https://ssphub.netlify.app/talk/2024-02-29-mauviere/mauviere.png" class="img-fluid"></p>


</section>

 ]]></description>
  <category>dataviz</category>
  <category>event</category>
  <guid>https://ssphub.netlify.app/talk/2024-02-29-mauviere/</guid>
  <pubDate>Thu, 29 Feb 2024 15:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/talk/2024-02-29-mauviere/mauviere.png" medium="image" type="image/png" height="80" width="144"/>
</item>
<item>
  <title>Le RAG pour limiter l’hallucination par l’IA ; l’avancée des bases de données vectorielles ; le format Parquet pour simplifier leur usage ; DuckDB débarque en version web</title>
  <link>https://ssphub.netlify.app/infolettre/infolettre_17/</link>
  <description><![CDATA[ 
<script src="https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min/vs/loader.js"></script>
<script type="module" id="qwebr-monaco-editor-init">

  // Configure the Monaco Editor's loader
  require.config({
    paths: {
      'vs': 'https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min/vs'
    }
  });
</script>
<script type="module">
// Global dictionary to store Monaco Editor instances
globalThis.qwebrEditorInstances = {};

// Function that builds and registers a Monaco Editor instance    
globalThis.qwebrCreateMonacoEditorInstance = function (cellData) {

  const initialCode = cellData.code;
  const qwebrCounter = cellData.id;
  const qwebrOptions = cellData.options;

  // Retrieve the previously created document elements
  let runButton = document.getElementById(`qwebr-button-run-${qwebrCounter}`);
  let resetButton = document.getElementById(`qwebr-button-reset-${qwebrCounter}`);
  let copyButton = document.getElementById(`qwebr-button-copy-${qwebrCounter}`);
  let editorDiv = document.getElementById(`qwebr-editor-${qwebrCounter}`);
  
  // Load the Monaco Editor and create an instance
  let editor;
  require(['vs/editor/editor.main'], function () {
    editor = monaco.editor.create(editorDiv, {
      value: initialCode,
      language: 'r',
      theme: 'vs-light',
      automaticLayout: true,           // Works wonderfully with RevealJS
      scrollBeyondLastLine: false,
      minimap: {
        enabled: false
      },
      fontSize: '17.5pt',              // Bootstrap is 1 rem
      renderLineHighlight: "none",     // Disable current line highlighting
      hideCursorInOverviewRuler: true  // Remove cursor indictor in right hand side scroll bar
    });

    // Store the official counter ID to be used in keyboard shortcuts
    editor.__qwebrCounter = qwebrCounter;

    // Store the official div container ID
    editor.__qwebrEditorId = `qwebr-editor-${qwebrCounter}`;

    // Store the initial code value and options
    editor.__qwebrinitialCode = initialCode;
    editor.__qwebrOptions = qwebrOptions;

    // Set at the model level the preferred end of line (EOL) character to LF.
    // This prevent `\r\n` from being given to the webR engine if the user is on Windows.
    // See details in: https://github.com/coatless/quarto-webr/issues/94
    // Associated error text: 
    // Error: <text>:1:7 unexpected input

    // Retrieve the underlying model
    const model = editor.getModel();
    // Set EOL for the model
    model.setEOL(monaco.editor.EndOfLineSequence.LF);

    // Dynamically modify the height of the editor window if new lines are added.
    let ignoreEvent = false;
    const updateHeight = () => {
      const contentHeight = editor.getContentHeight();
      // We're avoiding a width change
      //editorDiv.style.width = `${width}px`;
      editorDiv.style.height = `${contentHeight}px`;
      try {
        ignoreEvent = true;

        // The key to resizing is this call
        editor.layout();
      } finally {
        ignoreEvent = false;
      }
    };

    // Helper function to check if selected text is empty
    function isEmptyCodeText(selectedCodeText) {
      return (selectedCodeText === null || selectedCodeText === undefined || selectedCodeText === "");
    }

    // Registry of keyboard shortcuts that should be re-added to each editor window
    // when focus changes.
    const addWebRKeyboardShortCutCommands = () => {
      // Add a keydown event listener for Shift+Enter to run all code in cell
      editor.addCommand(monaco.KeyMod.Shift | monaco.KeyCode.Enter, () => {

        // Retrieve all text inside the editor
        qwebrExecuteCode(editor.getValue(), editor.__qwebrCounter, editor.__qwebrOptions);
      });

      // Add a keydown event listener for CMD/Ctrl+Enter to run selected code
      editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter, () => {

        // Get the selected text from the editor
        const selectedText = editor.getModel().getValueInRange(editor.getSelection());
        // Check if no code is selected
        if (isEmptyCodeText(selectedText)) {
          // Obtain the current cursor position
          let currentPosition = editor.getPosition();
          // Retrieve the current line content
          let currentLine = editor.getModel().getLineContent(currentPosition.lineNumber);

          // Propose a new position to move the cursor to
          let newPosition = new monaco.Position(currentPosition.lineNumber + 1, 1);

          // Check if the new position is beyond the last line of the editor
          if (newPosition.lineNumber > editor.getModel().getLineCount()) {
            // Add a new line at the end of the editor
            editor.executeEdits("addNewLine", [{
            range: new monaco.Range(newPosition.lineNumber, 1, newPosition.lineNumber, 1),
            text: "\n", 
            forceMoveMarkers: true,
            }]);
          }
          
          // Run the entire line of code.
          qwebrExecuteCode(currentLine, editor.__qwebrCounter, editor.__qwebrOptions);

          // Move cursor to new position
          editor.setPosition(newPosition);
        } else {
          // Code to run when Ctrl+Enter is pressed with selected code
          qwebrExecuteCode(selectedText, editor.__qwebrCounter, editor.__qwebrOptions);
        }
      });
    }

    // Register an on focus event handler for when a code cell is selected to update
    // what keyboard shortcut commands should work.
    // This is a workaround to fix a regression that happened with multiple
    // editor windows since Monaco 0.32.0 
    // https://github.com/microsoft/monaco-editor/issues/2947
    editor.onDidFocusEditorText(addWebRKeyboardShortCutCommands);

    // Register an on change event for when new code is added to the editor window
    editor.onDidContentSizeChange(updateHeight);

    // Manually re-update height to account for the content we inserted into the call
    updateHeight();

    // Store the editor instance in the global dictionary
    qwebrEditorInstances[editor.__qwebrCounter] = editor;

  });

  // Add a click event listener to the run button
  runButton.onclick = function () {
    qwebrExecuteCode(editor.getValue(), editor.__qwebrCounter, editor.__qwebrOptions);
  };

  // Add a click event listener to the reset button
  copyButton.onclick = function () {
    // Retrieve current code data
    const data = editor.getValue();
    
    // Write code data onto the clipboard.
    navigator.clipboard.writeText(data || "");
  };
  
  // Add a click event listener to the copy button
  resetButton.onclick = function () {
    editor.setValue(editor.__qwebrinitialCode);
  };
  
}
</script>





<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_17/robotroma.jfif" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:50.0%"></p>
</figure>
</div>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Astuce
</div>
</div>
<div class="callout-body-container callout-body">
<p><strong><em>Vous désirez intégrer la liste de diffusion ? L’inscription se fait <a href="https://grist.numerique.gouv.fr/o/ssphub/forms/jSjAV3L2F8mmiRVuVEpfF7/103">ici</a>.</em></strong></p>
</div>
</div>
<p>En ce début d’année 2024, nous prenons un peu de recul sur l’année écoulée et vous présentons les avancées marquantes de l’année 2023 dans le domaine de la data science. Ces avancées concernent l’intelligence artificielle générative, au cœur des débats médiatisés, mais aussi plusieurs développements technologiques très utiles pour l’analyse et la diffusion de bases de données. Des éléments plus techniques, qui ne sont pas nécessaires à la compréhension globale, sont présents dans des encadrés déroulables ou sont référencés dans les sections <em>“Pour en savoir plus”</em>.</p>
<p>La fin de la <em>newsletter</em> est consacrée à quelques annonces sur les prochains événements communautaires du réseau.</p>
<section id="panorama-des-avancées-ayant-eu-lieu-en-2023-dans-le-domaine-de-la-data-science" class="level2">
<h2 class="anchored" data-anchor-id="panorama-des-avancées-ayant-eu-lieu-en-2023-dans-le-domaine-de-la-data-science">Panorama des avancées ayant eu lieu en 2023 dans le domaine de la data science</h2>
<section id="les-ia-génératives-toujours-au-coeur-des-débats" class="level3">
<h3 class="anchored" data-anchor-id="les-ia-génératives-toujours-au-coeur-des-débats">Les IA génératives toujours au coeur des débats</h3>
<p>Dans la continuité de la sortie de <code>ChatGPT</code> en décembre 2022, les IA génératives ont continué en 2023 à focaliser une part importante de l’attention portée à la <em>data science</em>. Outre la publication de GPT-4 en mars (modèle embarqué dans la version Pro de <code>ChatGPT</code>), de nombreux grands modèles de langage (LLM) généralistes ont été publiés cette année : <code>Llama-2</code> (Meta), <code>Mixtral 7B</code> (Mistral), <code>Falcon 180B</code> (Technology Innovation Institute), <code>PaLM 2</code> (Google)…</p>
<p>Ces publications ont mis en avant le caractère stratégique de la mise à disposition de modèles <em>open source</em>. La récupération et la structuration de corpus massifs, l’entraînement de modèles intégrant des milliards de paramètres et l’évaluation <em>ex post</em> de ceux-ci est à la portée d’un nombre restreint d’acteurs. La publication en <em>open source</em> de modèles et de codes sources est dès lors indispensable pour, entre autres, être en mesure d’évaluer la pertinence scientifique des modèles ou permettre aux acteurs n’ayant pas ces moyens techniques et humains de pouvoir tout de même réutiliser ces modèles sur leurs propres données.</p>
<p>Néanmoins, malgré l’ouverture progressive de modèles, notamment par le biais d’une mise à disposition sur la plateforme <code>Hugging Face</code>, des contraintes limitent encore la réutilisation de ces modèles dans des infrastructures internes. Ces réseaux de neurones étant très gourmands en calculs du fait de leur architecture complexe (des milliards de paramètres pour les grands modèles de langage), afin d’obtenir une réponse du modèle il est généralement nécessaire d’effectuer les calculs par le biais de cartes graphiques (GPU), celles-ci permettant plus de parallélisme dans les calculs que les processeurs (CPU). Cependant, comme les GPU sont plus consommatrices d’énergie et plus coûteuses à l’achat du fait notamment d’une demande excédant l’offre, l’accès à cette ressource est limité pour de nombreux acteurs. Le retour à des modèles plus légers, pouvant être exploités depuis des architectures informatiques plus accessibles, constitue l’un des défis de l’année 2024.</p>
<p>Les débats concernant les droits d’exploitation commerciale d’informations collectées sur internet ont été nombreux en 2023. Après les plaintes médiatisées de <em>Getty Images</em> (envers Stability AI), d’un collectif d’auteurs célèbres (envers OpenAI), la grève des acteurs à Hollywood contre l’exploitation de leur image par des IA et des scénaristes contre l’utilisation des générateurs de texte, c’est maintenant le <em>New York Times</em> qui a déposé en décembre 2023 une plainte envers OpenAI auprès de la Cour Fédérale de Manhattan. A partir d’exemples, le journal américain met en avant le degré de confiance élevé que <code>ChatGPT</code> attribue aux informations issues des articles du quotidien, sans pour autant en citer la provenance, ni compenser financièrement le journal. Cela entraînerait un préjudice commercial dû à la réduction du trafic sur le site du <em>New York Times</em>. A contrario, le journal met en avant l’effet négatif sur son image que peuvent avoir des hallucinations attribuées au quotidien. Cette plainte fait suite à l’échec des négociations entre les deux acteurs au cours de l’année 2023. Ces actualités relatives aux droits d’auteurs interviennent dans un contexte où il s’agit de l’un des principaux axes d’intervention de l’<em>“Artificial Intelligence Act”</em> européen (voir <a href="../../infolettre/infolettre_16">Infolettre #16</a>).</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li>Un <a href="https://www.washingtonpost.com/technology/interactive/2023/ai-chatbot-learning/?itid=mc_magnet-ai_inline_collection_1">article</a> du <em>Washington Post</em> sur le corpus d’entraînement des LLM ;</li>
<li>Un <a href="https://ig.ft.com/generative-ai/">article</a> du <em>Financial Times</em> qui présente de manière très pédagogique la manière dont fonctionnent les LLM ;</li>
<li>Un <a href="https://huggingface.co/docs/transformers/llm_tutorial">tutoriel</a> sur les LLM par <code>Hugging Face</code> ;</li>
<li>Un <a href="https://www.nytimes.com/2023/08/16/technology/ai-gpu-chips-shortage.html">article</a> du <em>New York Times</em> sur la pénurie de GPU ;</li>
<li>Un article du site spécialisé <em><a href="https://www.theverge.com/2023/12/4/23988403/getty-lawsuit-stability-ai-copyright-infringement">The Verge</a></em> sur les dernières évolutions de la plainte de <em>Getty Images</em> ;</li>
<li>Un article de <a href="https://www.courrierinternational.com/article/litterature-george-r-r-martin-jonathan-franzen-et-john-grisham-partent-en-guerre-contre-chatgpt"><em>Courrier International</em></a> sur la plainte d’un collectif d’auteurs envers OpenAI ;</li>
<li><em>New York Times vs OpenAI</em> par <a href="https://www.lemonde.fr/pixels/article/2023/12/27/le-new-york-times-poursuit-en-justice-microsoft-et-openai-createur-de-chatgpt-pour-violation-de-droits-d-auteur_6207946_4408996.html">le <em>Monde</em></a> et le <a href="https://www.nytimes.com/2023/12/27/business/media/new-york-times-open-ai-microsoft-lawsuit.html"><em>New York Times</em></a> ;</li>
<li>Les chartes relatives au contenu produit par des IA génératives du <a href="https://www.gov.uk/government/publications/generative-ai-framework-for-hmg/generative-ai-framework-for-hmg-html">gouvernement britannique</a> et d’une vingtaine de médias français recensés par l’<a href="https://larevuedesmedias.ina.fr/les-medias-face-lintelligence-artificielle-20-chartes-passees-au-crible">INA</a>.</li>
</ul>
</div>
</div>
</section>
<section id="des-avancées-scientifiques-en-arrière-plan" class="level3">
<h3 class="anchored" data-anchor-id="des-avancées-scientifiques-en-arrière-plan">Des avancées scientifiques en arrière plan</h3>
<p>La tendance des LLM à l’hallucination, c’est-à-dire à la production de contenu plausible par sa forme mais factuellement faux, a été l’objet d’inquiétudes quant à la véracité des informations pouvant être mises en avant par les IA amenées à occuper une place croissante dans la diffusion de contenu. Pour faire face à ce défi, au cours de l’année 2023, les équipes de conception des LLM ont utilisé de manière croissante la technique du <strong>RAG (<em>Retrieval Augmentated Generation</em>)</strong>. Celle-ci consiste, pour les modélisateurs, à cadrer le comportement du LLM en faisant en sorte qu’il privilégie des informations issues d’un corpus adapté spécialement à une tâche. Pour faire l’analogie avec l’apprentissage humain, les modèles où le RAG intervient peuvent être comparés à des étudiants préparant une dissertation s’appuyant sur un dossier préparé par les évaluateurs. Ce contexte pourra être utilisé pour construire une réponse argumentée et des exemples plus pertinents.</p>
<p>Le succès des IA de discussion comme <code>ChatGPT</code> est intrinsèquement lié au travail humain qui a été mis en œuvre pour évaluer la pertinence des réponses proposées par le modèle afin de régulièrement mettre à jour le comportement du modèle. Sur une question donnée, l’humain évalue la réponse la plus pertinente faite par l’IA. A partir d’un volume suffisant d’évaluations, l’algorithme pourra, dans les prochaines situations similaires, faire un choix plus pertinent s’il apprend de ses erreurs. La technique ayant gagné cette année en popularité pour cette tâche est la <strong>DPO (<em>Direct Preference Optimization</em>)</strong> qui vise à simplifier l’intégration des retours humains dans le cycle de réentraînement d’un modèle. Cette problématique de supervision et d’amélioration continue d’un modèle dépasse d’ailleurs le cadre des modèles de langage : afin de s’assurer que les algorithmes ne perdent pas en qualité, l’évaluation humaine par le biais, par exemple, de campagnes de labellisation ou de retours des utilisateurs, est un enjeu important dans le cycle de vie de tout modèle mis en production.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li>La vidéo <a href="https://www.youtube.com/watch?v=bZQun8Y4L2A">“State of GPT”</a> par Andrew Karpathy ;</li>
<li>Un <a href="https://huggingface.co/blog/ray-rag">tutoriel</a> sur le RAG par <em>Hugging Face</em> ;</li>
<li>Le <a href="https://openai.com/research/learning-from-human-preferences">blog</a> présentant la technique du <em>Reinforcement learning with human feedbacks</em> par OpenAI ;</li>
<li>L’<a href="https://arxiv.org/pdf/2305.18290.pdf">article académique</a> présentant la DPO et un <a href="https://huggingface.co/blog/pref-tuning">tutoriel</a> d’<em>Hugging Face</em> ;</li>
<li>Un <a href="https://www.deeplearning.ai/the-batch/issue-231/">article de blog</a> d’Andrew Ng sur la DPO.</li>
</ul>
</div>
</div>
</section>
<section id="les-bases-de-données-vectorielles-gagnent-en-popularité" class="level3">
<h3 class="anchored" data-anchor-id="les-bases-de-données-vectorielles-gagnent-en-popularité">Les bases de données vectorielles gagnent en popularité</h3>
<p>Le langage de programmation <code>Python</code> est le <a href="https://www.tiobe.com/tiobe-index/">point d’entrée de référence</a> dans le domaine de la <em>data science</em>, mais pour des besoins plus spécialisés, des logiciels dédiés viennent s’y intégrer.</p>
<p>C’est le cas notamment des bases de données vectorielles comme <a href="https://www.trychroma.com/"><code>ChromaDB</code></a>. Ces bases facilitent la recherche de similarité entre documents textuels en exploitant des transformations de ceux-ci en vecteurs numériques (technique des <a href="https://ig.ft.com/generative-ai/"><em>embeddings</em></a>).</p>
<p>Par exemple, dans l’image ci-dessous, une base de données vectorielle pourra évaluer la similarité entre les termes en utilisant des techniques d’algèbre linéaire de manière plus efficace que ne le permettrait <code>Python</code>. Ce dernier est en effet un langage informatique généraliste, moins performant que des logiciels spécialisés pour faire de la recherche de similarité dans des corpus massifs. Dans une chaîne de production exploitant ce type de technique, <code>Python</code> servira de point d’entrée et déléguera ensuite les calculs complexes à la base de données vectorielle.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_17/embeddings.png" class="img-fluid figure-img"></p>
<figcaption>Un exemple d’<em>embedding</em> et de rapprochement de textes. Chaque bande représente une dimension latente de notre langage. Il est possible de rapprocher les termes à partir de celles-ci. Source: <a href="https://ig.ft.com/generative-ai/"><em>Financial Times</em></a>.</figcaption>
</figure>
</div>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li>Le <em>framework</em> <a href="https://www.langchain.com/"><code>LangChain</code></a> pour construire par le biais de <code>Python</code> des applications utilisant des LLM : création d’une interface pour poser des questions à un LLM, transformation de la question en vecteur numérique par le biais d’une base vectorielle comme <code>ChromaDB</code>, interrogation du LLM, renvoi à l’utilisateur d’une réponse… ;</li>
<li>Un <a href="https://realpython.com/chromadb-vector-database/">tutoriel de realpython.com</a> sur <a href="https://www.trychroma.com/"><code>ChromaDB</code></a>.</li>
</ul>
</div>
</div>
</section>
</section>
<section id="diffuser-des-données-au-format-parquet-pour-simplifier-leur-usage" class="level2">
<h2 class="anchored" data-anchor-id="diffuser-des-données-au-format-parquet-pour-simplifier-leur-usage">Diffuser des données au format <code>Parquet</code> pour simplifier leur usage</h2>
<p>Dans le domaine de la diffusion des données <em>open data</em>, l’Insee a expérimenté le format <code>Parquet</code> à deux reprises pendant l’année 2023. En premier lieu, pour la diffusion des données du <a href="https://www.insee.fr/fr/metadonnees/source/serie/s1046">Répertoire Electoral Unique</a>. Plus récemment, ce sont les données détaillées du recensement de la population qui ont été diffusées dans ce format, accompagnées d’un <a href="../../post/parquetRP">guide d’utilisation</a> mis en ligne sur le blog du SSP Hub (plus de détails dans l’<a href="../../infolettre/infolettre_16">infolettre #16</a>).</p>
<details>
<summary>
<p><em>Quelques exemples de retours sur la publication des données détaillées du recensement au format <code>Parquet</code>.</em></p>
</summary>
<div class="columns">
<div class="column" style="width:50%;">
<p><img src="https://git.lab.sspcloud.fr/ssplab/parquet_insee_contact/-/raw/master/img/retour_utilisateur_1.png" class="img-fluid" width="700"></p>
</div><div class="column" style="width:50%;">
<p><img src="https://git.lab.sspcloud.fr/ssplab/parquet_insee_contact/-/raw/master/img/retour_utilisateur_2.png" class="img-fluid" width="700"></p>
</div>
</div>
<div class="columns">
<div class="column" style="width:50%;">
<p><img src="https://git.lab.sspcloud.fr/ssplab/parquet_insee_contact/-/raw/master/img/img3.png" class="img-fluid" width="700"></p>
</div><div class="column" style="width:50%;">
<p><img src="https://git.lab.sspcloud.fr/ssplab/parquet_insee_contact/-/raw/master/img/img4.png" class="img-fluid" width="700"></p>
</div>
</div>
</details>
<p>Le format de données <code>Parquet</code> est très intéressant pour les <em>data scientists</em> intéressés par le traitement de données volumineuses. Il permet des gains de performance importants par rapport au CSV sans être dépendant d’un logiciel propriétaire (contrairement aux formats <code>.sas7bdat</code>, <code>dbase</code>, etc.). Par exemple, les données détaillées du recensement diffusées par l’Insee pèsent 450Mo au format <code>Parquet</code> contre 5Go au format CSV. Des outils de traitement optimisés existent pour faciliter l’utilisation de ce format. Parmi ceux-ci, cette année a été marquée par la montée en puissance de <code>DuckDB</code>. Il s’agit d’un logiciel qui est utilisable par le biais des principaux langages maîtrisés par les <em>data scientists</em> : <a href="https://duckdb.org/docs/api/python/overview.html"><code>Python</code></a>, <a href="https://duckdb.org/docs/api/r.html"><code>R</code></a>, <a href="https://duckdb.org/docs/api/wasm/overview.html"><code>JavaScript</code></a> ou directement en ligne de commande.</p>
<p>Sa capacité à gérer de grandes quantités de données en faisant des requêtes SQL optimisées sur un fichier au format <code>Parquet</code> rend <code>DuckDB</code> particulièrement approprié pour le traitement de données volumineuses (voir les éléments plus techniques, ci-dessous). Avec ce logiciel, les données du recensement peuvent être lues en quelques secondes alors qu’il fallait plusieurs dizaines de minutes dans les précédents formats. Pour des utilisateurs de l’écosystème de l’<em>open data</em> ou pour des organisations dont le patrimoine de données prend plus la forme de fichiers que de bases de données <code>PostGreSQL</code>, <code>DuckDB</code> est une opportunité technologique permettant de valoriser des données dont le traitement et la diffusion nécessitait jusqu’à présent des ressources computationnelles importantes.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<p>Ressources techniques:</p>
<ul>
<li>Un <a href="https://datalab.sspcloud.fr/launcher/ide/rstudio-sparkr?autoLaunch=true&amp;init.personalInit=%C2%ABhttps%3A%2F%2Fraw.githubusercontent.com%2FInseeFrLab%2Fformation-bceao%2Fmain%2Ftp%2Finit-tp.sh%C2%BB&amp;resources.limits.memory=%C2%AB100Gi%C2%BB&amp;persistence.size=%C2%AB40Gi%C2%BB"><em>notebook</em> <i class="fa-brands fa-r-project" aria-label="r-project"></i></a> sur <code>DuckDB</code> issu d’une <a href="https://inseefrlab.github.io/formation-bceao/">formation de l’Insee</a> donnée à la BCEAO ;</li>
<li>Une <a href="https://www.book.utilitr.org/03_fiches_thematiques/fiche_arrow">fiche sur <code>Arrow</code></a>, l’écosystème sous-jacent à <code>DuckDB</code>, dans la documentation collaborative <code>utilitR</code> ;</li>
<li>Le <a href="../../post/polars/">post de blog</a> sur la librairie <i class="fa-brands fa-python" aria-label="python"></i> <code>Polars</code>, une approche alternative à <code>DuckDB</code> ;</li>
<li>L’<a href="https://datalab.sspcloud.fr/data-explorer?source=https%3A%2F%2Fstatic.data.gouv.fr%2Fresources%2Frecensement-de-la-population-fichiers-detail-individus-localises-au-canton-ou-ville-2020-1%2F20231023-122841%2Ffd-indcvi-2020.parquet">explorateur de données du SSPCloud</a> qui repose sur <code>DuckDB</code>.</li>
</ul>
<p>Données diffusées par la statistique publique au format <code>Parquet</code> :</p>
<ul>
<li>Les données du <a href="https://www.data.gouv.fr/fr/datasets/bureaux-de-vote-et-adresses-de-leurs-electeurs/#/resources">Répertoire Electoral Unique</a> ;</li>
<li>Le guide d’utilisation des données du recensement de la population au format Parquet sous forme de <a href="../../post/parquetRP/">billet de blog</a>. Voir aussi l’<a href="../../infolettre/infolettre_16"><em>infolettre #16</em></a> ;</li>
<li>Les <a href="https://www.linkedin.com/feed/update/urn:li:activity:7163102904906678272/">données de la délinquance enregistrée par la police et gendarmerie nationales</a> publiées par le service statistique ministériel de la sécurité intérieur publiées au format Parquet.</li>
</ul>
<p>Sur le format <code>Parquet</code> :</p>
<ul>
<li>Un <a href="https://www.insee.fr/fr/information/7635827?sommaire=7635842">article</a> sur le format <code>Parquet</code> dans le <em>Courrier des stats n°9</em> écrit par Alexis Dondon et Pierre Lamarche ;</li>
<li>Le blog d’<a href="https://www.icem7.fr/outils/3-explorations-bluffantes-avec-duckdb-1-interroger-des-fichiers-distants/">Eric Mauvière</a> qui présente une série d’articles sur le format <code>Parquet</code> ;</li>
<li>La <a href="https://www.linkedin.com/feed/update/urn:li:activity:7133760348129505281?updateEntityUrn=urn%3Ali%3Afs_feedUpdate%3A%28V2%2Curn%3Ali%3Aactivity%3A7133760348129505281%29">présentation</a> de Romain Lesur sur le sujet pour l’atelier <em>Modernisation of Official Statistics</em> de l’UNECE.</li>
</ul>
</div>
</div>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-6-contents" aria-controls="callout-6" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Astuce</span>Des éléments plus techniques sur la gestion de la volumétrie des données
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-6" class="callout-6-contents callout-collapse collapse">
<div class="callout-body-container callout-body">
<p>Il existe principalement deux approches pour stocker, organiser et mettre à disposition des jeux de données structurés sous forme tabulaire : les <strong>fichiers</strong> et les <strong>bases de données relationnelles</strong>.</p>
<p>Les bases de données relèvent d’une approche systémique. Un système de gestion de base de données (SGBD) est un logiciel qui gère à la fois le stockage d’un ensemble de données reliées, permet de mettre à jour celles-ci (ajout ou suppression d’informations, modification des caractéristiques d’une table…) et qui gère également les modalités d’accès à la donnée (type de requête, utilisateurs ayant les droits en lecture ou en écriture…). L’un des logiciels les plus connus dans le domaine est <code>PostgreSQL</code>.</p>
<p>D’un autre côté, le stockage de données tabulaires sous forme de fichiers offre une approche plus décentralisée et flexible. Par rapport à des bases de données, les fichiers sont plus faciles à créer, partager et stocker et ne nécessitent pas systématiquement des logiciels spécialisés pour leur manipulation. Le stockage sous la forme de fichier consiste à organiser l’information présente dans un jeu de données dans des fichiers, de manière brute. Ces données peuvent être analysées sans recourir à un logiciel spécialisé. Même dans le cadre de formats propriétaires, comme le <code>.xlsx</code> ou <code>.sas7bdat</code>, le fait d’avoir une certaine forme de standardisation rend possible, même si ce n’est jamais parfaitement fiable, de lire ces données avec un autre logiciel que celui prévu initialement.</p>
<p>La logique de la base de données est donc très différente de celle du fichier. Par rapport à une base de données, l’approche des fichiers présente plusieurs avantages, à condition de privilégier des formats libres.</p>
<p>En premier lieu, les fichiers sont moins adhérents à un logiciel gestionnaire. Une transition d’un logiciel de traitement vers un autre n’implique pas de changer la source brute. En outre, alors que le traitement des bases de données nécessite l’intermédiation du logiciel de gestion adapté, les utilisateurs de <code>Python</code> ou <code>R</code> peuvent utiliser des fichiers à partir d’une librairie, donc un système beaucoup plus léger, qui sait comment transformer la donnée pour la retravailler depuis <code>Python</code> ou <code>R</code>.</p>
<p>Pour ces raisons, entre autres, il est plus pratique pour des utilisateurs finaux de données d’avoir accès à des fichiers plutôt qu’à des bases de données, à condition d’avoir les ressources computationnelles suffisantes pour pouvoir traiter ces fichiers.</p>
<p>Néanmoins, cette condition d’accès à des ressources computationnelles suffisantes peut représenter une contrainte limitante dans un environnement où les données sont de volume croissant. Dans les environnements où la volumétrie des données était importante, les bases de données ont connu une certaine popularité puisqu’elles permettaient de gérer efficacement de grandes quantités de données. Comme, de plus, les bases de données offraient une gestion plus fine et fiable des droits d’accès et d’écriture sur les bases que ne le permettaient des fichiers, cette approche a pu connaître une certaine popularité.</p>
<p>Le développement conjoint de formats de stockages orientés objets (comme le protocole <code>S3</code>, utilisé par les systèmes <em>cloud</em> modernes à l’image du <code>SSPCloud</code>) et d’outils de traitement efficaces comme <code>DuckDB</code> permet d’associer les avantages de ce dernier à ceux d’un système cohérent de fichiers partagés (lecture/écriture optimisées, dissociation des utilisateurs pouvant lire et écrire un fichier…).</p>
<p>Techniquement, <code>DuckDB</code> fonctionne de manière optimale avec des fichiers au format <code>Parquet</code>. Ce format de données, orienté colonne, permet en effet d’optimiser des traitements classiques des <em>data scientists</em> : sélectionner seulement certaines colonnes d’un jeu de données, regrouper des données pour faire des calculs d’agrégats, etc.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_17/parquet.png" class="img-fluid figure-img"></p>
<figcaption>Une illustration du principe du stockage orienté colonne (Source: <a href="https://towardsdatascience.com/demystifying-the-parquet-file-format-13adb0206705">Michael Berk</a>)</figcaption>
</figure>
</div>
<p>Par exemple, dans le schéma ci-dessus, si on ne s’intéresse qu’aux dates enregistrées, il suffit de ne prendre que le bloc de données <em>ad hoc</em>. Il n’est pas nécessaire de lire tout le fichier pour ne garder que les dates, comme ce serait le cas avec un format CSV.</p>
</div>
</div>
</div>
</section>
<section id="de-la-data-science-depuis-un-navigateur" class="level2">
<h2 class="anchored" data-anchor-id="de-la-data-science-depuis-un-navigateur">De la <em>data science</em> depuis un navigateur</h2>
<p>Le gain de popularité de <code>DuckDB</code> au cours de l’année 2023 s’explique en partie grâce à sa version web qui permet d’exécuter des traitements de données par le biais de navigateurs web, sans avoir à installer de logiciel spécialisé comme <code>Python</code> <i class="fa-brands fa-python" aria-label="python"></i> ou <i class="fa-brands fa-r-project" aria-label="r-project"></i>. C’est une approche typique du <a href="https://developer.mozilla.org/fr/docs/WebAssembly"><em>web assembly</em></a> qui consiste à mettre à disposition des logiciels de calculs scientifiques par le biais d’un simple navigateur grâce à <code>Javascript</code> <i class="fa-brands fa-js-square" aria-label="js-square"></i>, qui est disponible sur tout navigateur. Cette approche est intéressante pour les institutions proposant des <em>data visualisations</em> car elle peut permettre de mettre en oeuvre des manipulations de données complexes directement depuis la source brute par le biais du navigateur, donc sans recourir à des serveurs externes hébergés dans des <em>cloud</em>.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-7-contents" aria-controls="callout-7" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Faire du <i class="fa-brands fa-r-project" aria-label="r-project"></i> depuis le navigateur avec <code>webR</code>
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-7" class="callout-7-contents callout-collapse collapse">
<div class="callout-body-container callout-body">
<p>Il est maintenant possible de faire du <code>R</code> directement depuis un navigateur <em>web</em> grâce à <a href="https://docs.r-wasm.org/webr/latest/"><code>webR</code></a>, une librairie développée par <em>Posit</em> en 2023 et qui porte la grammaire <code>R</code> dans le navigateur sans recourir à <code>Shiny</code> (exemple à tester 👇️).</p>
<p>L’idée est que le code d’analyse de données est en <code>R</code> mais qu’en arrière plan c’est du <code>Javascript</code> qui servira à l’exécution. La librairie est encore jeune mais celle-ci est prometteuse pour faciliter la transition entre du code d’analyse de données en <code>R</code> et une application interactive.</p>
<div id="qwebr-insertion-location-1"></div>
<noscript>Please enable JavaScript to experience the dynamic code cell content on this page.</noscript>
<p>Un exemple plus complexe, utilisant le <em>package</em> <code>ggplot2</code>:</p>
<div id="qwebr-insertion-location-2"></div>
<noscript>Please enable JavaScript to experience the dynamic code cell content on this page.</noscript>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li>La <a href="https://docs.r-wasm.org/webr/latest/">documentation officielle</a> de <code>WebR</code> ;</li>
<li><a href="https://thinkr.fr/retour-vers-le-turfu-r-le-web-et-webr/">Un <em>post</em></a> sur le <em>web assembly</em> par <em>ThinkR</em> ;</li>
<li>L’extension <a href="https://quarto-webr.thecoatlessprofessor.com/"><code>quarto-webR</code></a> qui permet d’encapsuler du code <code>webR</code> dans un site web statique construit avec <code>Quarto</code> ;</li>
<li>Une <a href="https://observablehq.com/@hrbrmstr/webr-0-2-2-in-observable">démonstration</a> de <code>WebR</code> sur <code>Observable</code>.</li>
</ul>
</div>
</div>
</section>
<section id="prochains-événements-du-réseau" class="level2">
<h2 class="anchored" data-anchor-id="prochains-événements-du-réseau">Prochains événements du réseau</h2>
<section id="la-dataviz-pour-donner-du-sens-aux-données-et-communiquer-un-message-par-eric-mauvière-29-février-15h-16h" class="level3">
<h3 class="anchored" data-anchor-id="la-dataviz-pour-donner-du-sens-aux-données-et-communiquer-un-message-par-eric-mauvière-29-février-15h-16h">“La dataviz pour donner du sens aux données et communiquer un message” par Eric Mauvière (📅 29 février, 15h-16h)</h3>
<p>Le <strong>29 février (15h - 16h)</strong>, Eric Mauvière nous fera une présentation, avec de nombreux exemples issus de la statistique publique, de la manière dont une visualisation de données peut être construite pour transmettre un message clair aux lecteurs. Cette présentation permettra d’évoquer les bonnes pratiques et les outils simples pour construire des visualisations de données faciles à lire et à comprendre afin de rendre le message intelligible, efficace et utile à un large spectre de publics.</p>
<p>Cet événement aura lieu en visio sur <a href="https://insee-fr.zoom.us/j/92487784559?pwd=WVdsNUFNWXhUNnJYUW56WFdyNHlNdz09">Zoom</a>, il est ouvert à tous les membres du réseau. Pour les agents de la DG de l’Insee, une retransmission en salle 4-C-458 est organisée pour assister à la présentation puis échanger à l’issue de celle-ci.</p>
<p>Éric Mauvière est statisticien, passé par la diffusion et les études régionales de l’Insee. Il a ensuite créé le logiciel cartographique web <code>Géoclip</code> utilisé, par exemple, par le site <a href="https://statistiques-locales.insee.fr/">https://statistiques-locales.insee.fr/</a>. Plus récemment, il a participé à la conception du site <a href="https://vizagreste.agriculture.gouv.fr/">https://vizagreste.agriculture.gouv.fr/</a>, portail de visualisation de données du service statistique ministériel du ministère de l’Agriculture et de la Souveraineté alimentaire. Depuis 3 ans, au sein d’<code>Icem7</code>, il participe à la diffusion de connaissances sur les problématiques de <em>dataviz</em> et forme sur mesure en sémiologie graphique et analyse de données.</p>
<ul>
<li><a href="https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2024-02-09-mauviere/_La%20dataviz%20pour%20donner%20du%20sens%20aux%20données%20et%20communiquer%20un%20message_%20par%20Eric%20Mauvière.ics">Invitation outlook</a></li>
<li>Lien <a href="https://insee-fr.zoom.us/j/92487784559?pwd=WVdsNUFNWXhUNnJYUW56WFdyNHlNdz09">Zoom</a></li>
</ul>
</section>
<section id="masterclass-datascientest" class="level3">
<h3 class="anchored" data-anchor-id="masterclass-datascientest">Masterclass datascientest</h3>
<p>De nouvelles <em>masterclass</em> en partenariat avec <code>datascientest</code> seront organisées prochainement. Un questionnaire pour recenser les besoins, similaire à celui proposé l’an dernier, sera transmis prochainement pour évaluer le contenu à prioriser.</p>
</section>
<section id="programme-10" class="level3">
<h3 class="anchored" data-anchor-id="programme-10">Programme 10%</h3>
<p>La saison 3 du programme 10% démarre prochainement. Ce programme, issu des recommandations du <a href="https://www.numerique.gouv.fr/uploads/RAPPORT-besoins-competences-donnee.pdf">rapport de l’Inspection Générale de l’Insee et de la DINUM</a>, permet à des experts de la donnée de l’administration de monter en compétence en consacrant jusqu’à 10 % de leur temps de travail à des projets transversaux, à des formations ou encore à des moments informels qui favorisent l’échange entre pairs.</p>
<p>Le premier événement de la saison aura lieu le <strong>11 mars 2024 au Lieu de la Transformation Publique</strong> (Paris XV). L’objectif de cette journée est de définir collectivement les projets mutualisables pouvant entraîner des collaborations entre <em>data scientists</em> de différentes administrations pendant l’année 2024.<br>
Plus d’informations à venir sur le <a href="https://www.10pourcent.etalab.gouv.fr/">site du programme</a>.</p>
<ul>
<li>Inscription sur <a href="https://www.eventbrite.fr/e/billets-programme-10-journee-dideation-829916611927">Eventbrite</a>.</li>
</ul>
</section>
<section id="autoformation-de-découverte-à-python" class="level3">
<h3 class="anchored" data-anchor-id="autoformation-de-découverte-à-python">Autoformation de découverte à <code>Python</code></h3>
<p>Depuis quelques semaines, une nouvelle formation est apparue au catalogue de formation de l’Insee et sur le <a href="https://www.sspcloud.fr/formation">portail de formation du SSPCloud</a> : une <strong>auto-formation de découverte de <code>Python</code></strong>, construite et mentorée par les équipes innovation de l’Insee.</p>
<p>Chaque chapitre de formation, disponible sous la forme de <em>notebooks <code>Jupyter</code></em>, peut être ouvert en un clic à partir du <a href="https://www.sspcloud.fr/formation?search=&amp;path=%5B%22Initiation%20%C3%A0%20Python%22%5D">catalogue de formation</a> du <code>SSPCloud</code>. Ces ressources sont disponibles en continu, au-delà des périodes délimitées pour la formation.</p>
<p>Des cycles de 6 semaines pendant lesquels les participants peuvent bénéficier d’un mentorat ont vocation à être organisés régulièrement. Les premiers formés selon cette modalité ont commencé leur apprentissage en ce début d’année 2024.</p>
<p>Ce système de mentorat prend deux formes :</p>
<ul>
<li>tout au long de la formation : vous pouvez poser toutes vos questions sur le canal Tchap dédié ; les mentors de la formation répondent rapidement, afin que vous ne restiez jamais bloqué ;</li>
<li>ponctuellement : une visio est réalisée si vous le désirez avec 1-2 mentors afin de pouvoir discuter plus en détail des problèmes que vous pouvez rencontrer.</li>
</ul>
<p>Ce système de mentorat a l’avantage à la fois de favoriser une pédagogie par la pratique continue qui a fait ses preuves pour l’apprentissage des langages de programmation, tout en laissant à chacun la possibilité d’avancer à son rythme.</p>
<p>Les dates des prochains cycles de mentorat seront prochainement communiquées. Il est néanmoins possible, en attendant, d’explorer les ressources disponibles sur le <code>SSPCloud</code> ainsi que rejoindre le <a href="https://matrix.to/#/#sspy:agent.finances.tchap.gouv.fr">canal <code>Tchap</code> <code>SSPy - Formation "Initiation à Python"</code></a> afin d’échanger sur celle-ci (poser des questions de compréhension, comprendre un <em>bug</em>, assister les collègues bloqués, etc.).</p>


</section>
</section>

 ]]></description>
  <category>Infolettre</category>
  <guid>https://ssphub.netlify.app/infolettre/infolettre_17/</guid>
  <pubDate>Sat, 20 Jan 2024 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/infolettre/infolettre_17/robotroma.jfif" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Rétrospective du réseau en 2023 (cocorico, beaucoup de nouveaux inscrits !) ; des nouvelles règles européennes pour l’IA ; le recensement de la population au format parquet ; un explorateur de fichier sur le SSPCloud</title>
  <link>https://ssphub.netlify.app/infolettre/infolettre_16/</link>
  <description><![CDATA[ 





<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_16/santa.png" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:50.0%"></p>
</figure>
</div>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Astuce
</div>
</div>
<div class="callout-body-container callout-body">
<p><strong><em>Vous désirez intégrer la liste de diffusion ? L’inscription se fait <a href="https://grist.numerique.gouv.fr/o/ssphub/forms/jSjAV3L2F8mmiRVuVEpfF7/103">ici</a>.</em></strong></p>
</div>
</div>
<p>Noël approchant, avant d’ouvrir vos cadeaux, de dévorer une bûche ou tout autre met délicieux, nous vous proposons de nous retourner sur la progression de l’audience du réseau durant l’année 2023. Cette newsletter commencera ainsi par une rétrospective du réseau, en écho à celle de l’<a href="../../infolettre/infolettre_09/index.html">année 2022</a>. Une partie consacrée aux actualités de la <em>data science</em> suivra.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-2-contents" aria-controls="callout-2" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Making of
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-2" class="callout-2-contents callout-collapse collapse">
<div class="callout-body-container callout-body">
<p><code>Observable</code> est à la fois un langage visant à simplifier l’usage de <code>JavaScript</code> <i class="fa-brands fa-js-square" aria-label="js-square"></i> pour mettre en oeuvre des visualisations interactives et une <a href="https://observablehq.com/">plateforme</a> permettant de simplifier la mise à disposition de ces visualisations sous une forme de <em>notebook</em>.</p>
<p>Les statistiques de comptage sont enregistrées sous format <code>Parquet</code> sur le système de stockage <code>S3</code> du <code>SSPCloud</code>. L’intégration native de <code>DuckDB</code> à <code>Observable</code> permet au navigateur <em>web</em> de lire et d’effectuer des manipulations de données à travers des requêtes SQL de manière très efficace. Sur ce sujet, outre la <a href="https://observablehq.com/documentation/data/databases/database-clients#duckdb">documentation officielle d’<code>Observable</code></a>, il est recommandé de lire le <a href="https://observablehq.com/@ericmauviere/duckdb-redonne-nouvelle-vie-sql">tutoriel d’Eric Mauvière</a>.</p>
<p>La librairie <a href="https://observablehq.com/@observablehq/plot"><code>Plot</code></a> propose de nombreuses fonctionalités utiles pour construire des visualisations interactives. Sa logique est assez proche de celle des <em>frameworks</em> <a href="https://observablehq.com/@observablehq/plot-from-ggplot2"><code>ggplot2</code> en <code>R</code></a> ou <a href="https://observablehq.com/@observablehq/plot-overview-for-matplotlib-users"><code>matplotlib</code> en <code>Python</code></a>.</p>
<p>Ce <em>post</em> s’appuie sur <a href="https://quarto.org/docs/interactive/ojs/"><code>Quarto</code></a> qui permet de créer une page <em>web</em> statique autosuffisante à partir d’une suite d’instructions dans des blocs <code>{ojs}</code>. Cette méthode est très intéressante pour l’intégration de figures <code>JavaScript</code> dans des sites <em>web</em> complets générés de manière automatique. Le code utilisé est mis à disposition des curieux par le biais de menus déroulants.</p>
<p>L’ensemble des codes sources nécessaires à la reproduction de cette page sont disponibles sur le <a href="https://github.com/InseeFrLab/ssphub/blob/main/infolettre/infolettre_16/"><code>Github  inseefrlab/ssphub</code></a>. Pour limiter les duplications de code, les scripts ont été modularisés dans des fichiers séparés.<br>
Les éléments ne sont pas nécessairement présentés dans l’ordre car <code>JavaScript</code> est un langage <em>asynchrone</em>, les éléments ne sont pas executés dans l’ordre de définition mais dans l’ordre par lequel ils sont nécessaires pour obtenir un objet donné.</p>
</div>
</div>
</div>
<section id="rétrospective-du-réseau-en-2023" class="level2">
<h2 class="anchored" data-anchor-id="rétrospective-du-réseau-en-2023">Rétrospective du réseau en 2023</h2>
<section id="une-audience-en-progression" class="level3">
<h3 class="anchored" data-anchor-id="une-audience-en-progression">Une audience en progression</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="108" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 107;"><span id="cb1-108"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div&gt;&lt;span class = "underline-big"&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>start_count<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/span&gt; personnes faisaient partie de la liste de diffusion en début d'année 2023.&lt;/div&gt;&lt;br&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-1-1" data-nodetype="expression">

</div>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="109" data-source-offset="-148" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 108;"><span id="cb2-109"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>plot_bar_participants<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;&lt;br&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-1-2" data-nodetype="expression">

</div>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb3" data-startfrom="110" data-source-offset="-194" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 109;"><span id="cb3-110"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>message<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;&lt;br&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-1-3" data-nodetype="expression">

</div>
</div>
</div>
</div>
<details>
<summary>
Découvrir le code
</summary>
<p>Voir plus bas la définition des objets Javascript 👇️</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode javascript code-with-copy"><code class="sourceCode javascript"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div&gt;&lt;span class = "underline-big"&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>start_count<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/span&gt; personnes faisaient parti de la liste de diffusion en début d'année.&lt;/div&gt;&lt;br&gt;`</span></span>
<span id="cb4-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>plot_bar_participants<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;&lt;br&gt;`</span></span>
<span id="cb4-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>message<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;`</span></span></code></pre></div></div>
</details>
<p>A l’exception du mois d’août (pause estivale oblige), la progression de l’audience a été assez régulière grâce aux événements et contenus publiés sur le site du <code>SSP Hub</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb5" data-startfrom="113" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 112;"><span id="cb5-113"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div&gt;Pendant l'année 2023, le réseau a ainsi connu &lt;span class="underline-big"&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>events<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/span&gt; événements et publications de contenu (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">countEvents</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Infolettre"</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">countEvents</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Post de blog"</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">countEvents</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Evénement virtuel ou présentiel"</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">countEvents</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Masterclass"</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">).&lt;/div&gt;&lt;br&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="expression">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb6" data-startfrom="136" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 135;"><span id="cb6-136"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>lineplot<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-3-1" data-nodetype="expression">

</div>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb7" data-startfrom="137" data-source-offset="-29" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 136;"><span id="cb7-137"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>warm_strip<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-3-2" data-nodetype="expression">

</div>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb8" data-startfrom="138" data-source-offset="-60" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 137;"><span id="cb8-138"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">md</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`__Choisir les événements du réseau à afficher 👇️__`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-3-3" data-nodetype="expression">

</div>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb9" data-startfrom="139" data-source-offset="-116" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 138;"><span id="cb9-139"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>viewof events_chosen_figure1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-3-4" data-nodetype="expression">

</div>
</div>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb10" data-startfrom="140" data-source-offset="-165" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 139;"><span id="cb10-140"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>table_events<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-3-5" data-nodetype="expression">

</div>
</div>
</div>
</div>
<details>
<summary>
Code pour générer les différents blocs de cette figure
</summary>
<details>
<summary>
Code pour générer la figure principale
</summary>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="annotated-cell-11" data-startfrom="145" data-source-offset="0" data-llms-code-original="// Voir plus bas 👇️ les arrays utilisés
// Animation faite avec le Scrubber ci-dessous
lineplot = Plot.plot({
    y: {
        grid: true,
        label: &quot;Nombre d'inscrits&quot;
    },
    x: {
        label: &quot;Date&quot;,
        domain: [new Date(&quot;2023-01-10&quot;), new Date(&quot;2023-12-09&quot;)]
    },
    color: {
        range: Object.values(color_mapping_events),
        domain: Object.keys(color_mapping_events),
        label: &quot;Type d'événement&quot;
    }, 
    marginLeft: 50,
    marks: [
        Plot.line(
          serie_contacts, {
            x: &quot;date&quot;, y: &quot;mail&quot;,
            stroke: &quot;#6886bb&quot;,
            tip: &quot;xy&quot;
            }),
        Plot.crosshairX(serie_contacts_complete, { //<1>
            x: (d) => new Date(d.date), y: &quot;mail&quot;, stroke: &quot;red&quot;
            }),
        Plot.dot(
          serie_contacts_complete,
          Plot.pointerX({x: (d) => new Date(d.date), y: &quot;mail&quot;, stroke: &quot;red&quot;})), //<2>
        Plot.dot(serie_contacts, {
            x: &quot;date&quot;, y: &quot;mail&quot;,
            stroke: &quot;#6886bb&quot;,
            fill: &quot;#6886bb&quot;,
            title: &quot;Effectif&quot;
            }),
        Plot.tickX(events_data_figure1_b, {
            x: (d) => new Date(d.date), text: html``,
            stroke: &quot;type&quot;,
            opacity: 0.1,
            color: &quot;x&quot;,
            tip: true
            }),            
        Plot.axisX(events_data_figure1_b, {
            x: (d) => new Date(d.date),
            text: &quot;&quot;,
            color: &quot;type&quot;
            }),
    ]
})" style="background: #f1f3f5;"><pre class="sourceCode js code-annotation-code code-with-copy code-annotated"><code class="sourceCode javascript" style="counter-reset: source-line 144;"><span id="annotated-cell-11-145"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Voir plus bas 👇️ les arrays utilisés</span></span>
<span id="annotated-cell-11-146"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Animation faite avec le Scrubber ci-dessous</span></span>
<span id="annotated-cell-11-147">lineplot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>({</span>
<span id="annotated-cell-11-148">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {</span>
<span id="annotated-cell-11-149">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">grid</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">true</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-150">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nombre d'inscrits"</span></span>
<span id="annotated-cell-11-151">    }<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-152">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {</span>
<span id="annotated-cell-11-153">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Date"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-154">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">domain</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2023-01-10"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2023-12-09"</span>)]</span>
<span id="annotated-cell-11-155">    }<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-156">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">color</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {</span>
<span id="annotated-cell-11-157">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">range</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Object</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">values</span>(color_mapping_events)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-158">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">domain</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Object</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">keys</span>(color_mapping_events)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-159">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Type d'événement"</span></span>
<span id="annotated-cell-11-160">    }<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> </span>
<span id="annotated-cell-11-161">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marginLeft</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-162">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marks</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="annotated-cell-11-163">        Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">line</span>(</span>
<span id="annotated-cell-11-164">          serie_contacts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {</span>
<span id="annotated-cell-11-165">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"date"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mail"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-166">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">stroke</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#6886bb"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-167">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">tip</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xy"</span></span>
<span id="annotated-cell-11-168">            })<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<button class="code-annotation-anchor" data-target-cell="annotated-cell-11" data-target-annotation="1">1</button><span id="annotated-cell-11-169" class="code-annotation-target">        Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">crosshairX</span>(serie_contacts_complete<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {</span>
<span id="annotated-cell-11-170">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> (d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mail"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">stroke</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span></span>
<span id="annotated-cell-11-171">            })<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-172">        Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dot</span>(</span>
<span id="annotated-cell-11-173">          serie_contacts_complete<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<button class="code-annotation-anchor" data-target-cell="annotated-cell-11" data-target-annotation="2">2</button><span id="annotated-cell-11-174" class="code-annotation-target">          Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pointerX</span>({<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> (d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mail"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">stroke</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>}))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-175">        Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dot</span>(serie_contacts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {</span>
<span id="annotated-cell-11-176">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"date"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mail"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-177">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">stroke</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#6886bb"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-178">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fill</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#6886bb"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-179">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">title</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Effectif"</span></span>
<span id="annotated-cell-11-180">            })<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-181">        Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tickX</span>(events_data_figure1_b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {</span>
<span id="annotated-cell-11-182">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> (d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">text</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">``</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-183">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">stroke</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"type"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-184">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">opacity</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-185">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">color</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-186">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">tip</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">true</span></span>
<span id="annotated-cell-11-187">            })<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span>            </span>
<span id="annotated-cell-11-188">        Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">axisX</span>(events_data_figure1_b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {</span>
<span id="annotated-cell-11-189">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> (d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-190">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">text</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-191">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">color</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"type"</span></span>
<span id="annotated-cell-11-192">            })<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-11-193">    ]</span>
<span id="annotated-cell-11-194">})</span><div class="code-annotation-gutter-bg"></div><div class="code-annotation-gutter"></div></code></pre></div></div>
<div class="cell-annotation">
<dl class="code-annotation-container-hidden code-annotation-container-grid">
<dt data-target-cell="annotated-cell-11" data-target-annotation="1">1</dt>
<dd>
<span data-code-cell="annotated-cell-11" data-code-lines="169" data-code-annotation="1">Elément de réactivité lorsque la souris passe sur la figure.</span>
</dd>
<dt data-target-cell="annotated-cell-11" data-target-annotation="2">2</dt>
<dd>
<span data-code-cell="annotated-cell-11" data-code-lines="174" data-code-annotation="2">Elément de réactivité lorsque la souris passe sur la figure.</span>
</dd>
</dl>
</div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-4" data-nodetype="declaration">

</div>
</div>
</div>
</details>
<details>
<summary>
Code pour générer la bande sous la figure principale
</summary>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="annotated-cell-12" data-startfrom="390" data-source-offset="0" data-llms-code-original="warm_strip = Plot.plot({ //<1>
  height: 40,
  marginLeft: 50,
  color: {
    scheme: &quot;ylorrd&quot;,
    },
  marks: [
    Plot.crosshair(serie_contacts_complete, {
      x: (d) => new Date(d.date),
      strokeOpacity: 0.2,
      fill: &quot;mail&quot;,
      interval: d3.utcDay.every(3),
      inset: 0 // no gaps
    }),
    Plot.barX(serie_contacts_complete, {
      x: (d) => new Date(d.date),
      strokeOpacity: 0.2,
      fill: &quot;mail&quot;,
      interval: d3.utcDay.every(3),
      inset: 0 // no gaps
    })
  ]
})" style="background: #f1f3f5;"><pre class="sourceCode js code-annotation-code code-with-copy code-annotated"><code class="sourceCode javascript" style="counter-reset: source-line 389;"><button class="code-annotation-anchor" data-target-cell="annotated-cell-12" data-target-annotation="1">1</button><span id="annotated-cell-12-390" class="code-annotation-target">warm_strip <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>({</span>
<span id="annotated-cell-12-391">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">height</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-392">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marginLeft</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-393">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">color</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {</span>
<span id="annotated-cell-12-394">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">scheme</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ylorrd"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-395">    }<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-396">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marks</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="annotated-cell-12-397">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">crosshair</span>(serie_contacts_complete<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {</span>
<span id="annotated-cell-12-398">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> (d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-399">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">strokeOpacity</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-400">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fill</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mail"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-401">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">interval</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> d3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utcDay</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">every</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-402">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">inset</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// no gaps</span></span>
<span id="annotated-cell-12-403">    })<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-404">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">barX</span>(serie_contacts_complete<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {</span>
<span id="annotated-cell-12-405">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> (d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-406">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">strokeOpacity</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-407">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fill</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mail"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-408">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">interval</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> d3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utcDay</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">every</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-12-409">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">inset</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// no gaps</span></span>
<span id="annotated-cell-12-410">    })</span>
<span id="annotated-cell-12-411">  ]</span>
<span id="annotated-cell-12-412">})</span><div class="code-annotation-gutter-bg"></div><div class="code-annotation-gutter"></div></code></pre></div></div>
<div class="cell-annotation">
<dl class="code-annotation-container-hidden code-annotation-container-grid">
<dt data-target-cell="annotated-cell-12" data-target-annotation="1">1</dt>
<dd>
<span data-code-cell="annotated-cell-12" data-code-lines="390" data-code-annotation="1">Inspiration : https://observablehq.com/<span class="citation" data-cites="observablehq/plot-warming-stripes">@observablehq/plot-warming-stripes</span></span>
</dd>
</dl>
</div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-5" data-nodetype="declaration">

</div>
</div>
</div>
</details>
<details>
<summary>
Code pour générer le sélecteur d’événements
</summary>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" data-startfrom="0" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -1;"><span id="cb11-0"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">underline_event</span>(x){</span>
<span id="cb11-1">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> x_underlined <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;span style="text-transform: capitalize; border-bottom: solid 4px </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>color_mapping_events[x]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; margin-bottom: -2px;"&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/span&gt;`</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb11-2">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> x_underlined</span>
<span id="cb11-3">}</span>
<span id="cb11-4"></span>
<span id="cb11-5">viewof events_chosen_figure1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">checkbox</span>(</span>
<span id="cb11-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(events<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>(d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb11-7">    {</span>
<span id="cb11-8">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">value</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(events<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>(d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb11-9">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">format</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">underline_event</span>(x)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb11-10">    }</span>
<span id="cb11-11">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-6-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-6-2" data-nodetype="declaration">

</div>
</div>
</div>
</div>
</details>
<details>
<summary>
Code pour générer la table interactive
</summary>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb12--1">table_events <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb12-0">    events_data_figure1_b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb12-1">    {</span>
<span id="cb12-2">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">columns</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"date"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"event"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"type"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb12-3">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">header</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {</span>
<span id="cb12-4">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">date</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Date"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb12-5">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">event</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Evénement du réseau"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb12-6">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">type</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Type d'événement"</span></span>
<span id="cb12-7">        }<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb12-8">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">format</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {</span>
<span id="cb12-9">            <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">type</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> (x) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb12-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">            &lt;span style="text-transform: capitalize; display: inline-flex; align-items: center;"&gt;</span></span>
<span id="cb12-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;span style="border-bottom: solid 1px </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>color_mapping_events[x]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; margin-bottom: -2px;"&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/span&gt;</span></span>
<span id="cb12-12"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;span style="width: 10px; height: 10px; margin-left: 5px; background-color: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>color_mapping_events[x]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">;"&gt;&lt;/span&gt;</span></span>
<span id="cb12-13"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;/span&gt;</span></span>
<span id="cb12-14"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">            `</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb12-15">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">event</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> (x) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;a </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>links_website_ssphub[x] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!==</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">undefined</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?</span> <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`href="</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>links_website_ssphub[x]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" target="_blank"`</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/a&gt;`</span></span>
<span id="cb12-16">        }</span>
<span id="cb12-17">    })</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-7" data-nodetype="declaration">

</div>
</div>
</div>
</details>
</details>
</section>
<section id="du-contenu-qui-intéresse-au-delà-des-statisticiens-publics" class="level3">
<h3 class="anchored" data-anchor-id="du-contenu-qui-intéresse-au-delà-des-statisticiens-publics">Du contenu qui intéresse au-delà des statisticiens publics</h3>
<p>Si les statistiques concernant la composition du réseau parmi les organismes de la statistique publique sont relativement stables par rapport à l’an dernier, le changement principal ayant eu lieu en 2023 est l’ouverture progressive à des publics hors de la statistique publique (administrations hors du SSP, chercheurs et étudiants…)</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb13" data-startfrom="0" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -1;"><span id="cb13-0"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">html</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`&lt;div&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>barplot_ssp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-8" data-nodetype="expression">

</div>
</div>
</div>
<details>
<summary>
Code pour générer la figure
</summary>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb14--1">barplot_ssp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>({</span>
<span id="cb14-0">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marginLeft</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-1">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marginRight</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-2">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Frequency"</span>}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-3">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">null</span>}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-4">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">color</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {</span>
<span id="cb14-5">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">domain</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Hors du SSP"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Service Statistique Public (SSP)"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-6">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">range</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forestgreen"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#6886bb"</span>]</span>
<span id="cb14-7">    }<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-8">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marks</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="cb14-9">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">barX</span>(hors_ssp_data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-10">    {</span>
<span id="cb14-11">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SSP"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-12">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fy</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> (d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">toLocaleString</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fr"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {</span>
<span id="cb14-13">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"month"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"long"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-14">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"year"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"numeric"</span></span>
<span id="cb14-15">      })<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-16">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mail"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">inset</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fill</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SSP"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">sort</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mail"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-17">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">tip</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">true</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">channels</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">share</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> (d)  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">share</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">toFixed</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">%`</span>}</span>
<span id="cb14-18">    })<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-19">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">axisY</span>({<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">textAnchor</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"start"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fill</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">dx</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>})<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb14-20">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ruleX</span>([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb14-21">  ]</span>
<span id="cb14-22">})</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-9" data-nodetype="declaration">

</div>
</div>
</div>
</details>
<p>Les deux dernières publications sur le site du réseau, à savoir l’<a href="../../infolettre/infolettre_15/index.html">infolettre #15</a> sur le réentrainement des modèles de langage et, surtout, le <a href="../../post/parquetRP/index.html"><em>post</em> de blog</a> sur la publication du recensement de la population au format <code>Parquet</code> ont connu un écho important hors des cercles de <em>data scientist</em> du service statistique public et ont amené de nouveaux publics à suivre les contenus proposés par le réseau.</p>
</section>
</section>
<section id="actualités-de-la-data-science" class="level1">
<h1>Actualités de la <em>data science</em></h1>
<section id="la-startup-mistral-ai-publie-un-modèle-à-létat-de-lart" class="level2">
<h2 class="anchored" data-anchor-id="la-startup-mistral-ai-publie-un-modèle-à-létat-de-lart">La startup Mistral AI publie un modèle à l’état de l’art</h2>
<p>Mistral AI, une <em>startup</em> française spécialisée dans l’intelligence artificielle, vient de publier un modèle nommé <a href="https://mistral.ai/news/mixtral-of-experts/"><code>Mixtral</code></a> qui repose sur le principe du <a href="https://huggingface.co/blog/moe"><em>mixture of experts</em></a>. Cette technique consiste à privilégier une architecture construite à partir de sous-modèles spécialisés plutôt qu’un modèle généraliste qui s’adapte en fin de procédure à une question spécialisée. Dans ce type de modèles, l’enjeu est ainsi d’interpréter la question pour diriger la réponse vers l’expert adéquat : si une question porte sur un sujet de cuisine, un.e expert.e spécialisé.e en code sera de peu de secours.</p>
<p>D’après les premières évaluations publiées, ce modèle surpasserait les capacités des autres modèles ouverts (notamment <code>Llama 2</code>) et s’approcherait des performances de GPT 3.5, le modèle derrière la version gratuite de ChatGPT. Cette annonce a eu lieu en pleine période de levée de fonds pour Mistral AI qui aurait obtenu un financement de 385 millions d’euros.</p>
<details>
<summary>
Tableau des performances (source: <a href="https://mistral.ai/news/mixtral-of-experts/">Mistral AI</a>)
</summary>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://mistral.ai/images/news/mixtral-of-experts/overview.png" class="img-fluid figure-img"></p>
<figcaption>Tableau des performances publié par Mistral AI</figcaption>
</figure>
</div>
</details>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li>Un <a href="https://www.lemonde.fr/economie/article/2023/12/11/la-start-up-francaise-mistral-ai-a-leve-385-millions-d-euros_6205065_3234.html">article du <em>Monde</em></a> sur l’entreprise Mistral AI ;</li>
<li>Le modèle <code>Mixtral</code> sur <a href="https://huggingface.co/docs/transformers/model_doc/mixtral">Huggingface</a> ;</li>
<li>Le principe des architectures <em>mixture of experts</em> (<a href="https://en.wikipedia.org/wiki/Mixture_of_experts">article Wikipedia</a>).</li>
</ul>
</div>
</div>
</section>
<section id="leurope-parvient-à-un-accord-sur-les-premières-règles-au-monde-en-matière-dia" class="level2">
<h2 class="anchored" data-anchor-id="leurope-parvient-à-un-accord-sur-les-premières-règles-au-monde-en-matière-dia">L’Europe parvient à un accord sur les premières règles au monde en matière d’IA</h2>
<p>Dans un accord provisoire signé le 9 décembre 2023 et nommé <em>“Artificial Intelligence Act”</em>, les États Membres et le Parlement européen ont établi une proposition relative à des règles harmonisées concernant l’intelligence artificielle (IA).</p>
<p>Débutées en 2018, avant que les IA génératives ne deviennent si populaires, ces discussions dépassent le cadre exclusif de ces dernières. Néanmoins, concernant celles-ci, le compromis prévoit une approche différenciée suivant le contexte de développement et l’usage de ces modèles. Outre le respect des règles européennes de propriété intellectuelle, les développeurs de modèles génératifs devront s’assurer que les produits diffusés sont bien identifiés comme artificiels, afin de limiter la diffusion de <a href="https://fr.wikipedia.org/wiki/Deepfake"><em>deepfakes</em></a>. Les développeurs de ces modèles devront également communiquer sur la qualité des données utilisées pour entraîner les modèles et sur le coût énergétique de ceux-ci. Les modèles <em>open source</em> et ceux construits à des fins de recherche bénéficient d’exemptions de ces règles.</p>
<p>Des contraintes renforcées s’appliqueront aux systèmes jugés à <em>“haut risque”</em> dans des domaines comme la défense, l’éducation, les ressources humaines ou encore la santé. Pour ces systèmes, il sera nécessaire de réaliser une analyse d’impact avant la mise sur le marché. Par ailleurs, une obligation de transparence et d’explicabilité des modèles est mise en place afin d’être en mesure de comprendre les règles de décision de ces IA.</p>
<p>L’accord provisoire interdit également l’utilisation de l’IA dans quelques domaines, jugés trop sensibles. Par exemple, la reconnaissance faciale de masse est interdite, hormis lorsque celle-ci est justifiée par des motifs de sécurité nationale. D’autres utilisations, qui peuvent amener à des dérives, comme la notation sociale basée sur le comportement ou des caractéristiques personnelles, sont interdits. Les travaux se poursuivront maintenant au niveau technique dans les semaines à venir afin de mettre au point les détails du nouveau règlement. Une fois ces travaux terminés, la présidence présentera le texte de compromis aux représentants des États membres pour approbation.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li>La <a href="https://www.consilium.europa.eu/fr/press/press-releases/2023/12/09/artificial-intelligence-act-council-and-parliament-strike-a-deal-on-the-first-worldwide-rules-for-ai/">présentation de l’accord</a> sur le site web du Conseil de l’Europe.</li>
</ul>
</div>
</div>
</section>
<section id="nouveau-post-de-blog-diffusion-du-recensement-de-la-population-au-format-parquet" class="level2">
<h2 class="anchored" data-anchor-id="nouveau-post-de-blog-diffusion-du-recensement-de-la-population-au-format-parquet">Nouveau <em>post</em> de blog: diffusion du recensement de la population au format <code>Parquet</code></h2>
<p>Chaque année, l’Insee diffuse des statistiques construites à partir du recensement de la population, l’une des enquêtes phares de l’institut. Pour accompagner ces résultats et permettre à de nombreux acteurs de creuser ces données très riches dans des dimensions qui les intéressent, l’Insee diffuse également des bases de données détaillées construites après anonymisation de près de 20 millions de données individuelles.</p>
<p>Ces données, d’une extrême richesse, étaient historiquement complexes à manipuler du fait de leur volumétrie. La diffusion de celles-ci sous le format <code>Parquet</code>, une première mondiale parmi les instituts de statistique publique, vise à simplifier leur exploitation. Pour accompagner cette innovation, en partenariat avec les services de diffusion de l’Insee, le <a href="https://ssphub.netlify.app/post/parquetrp/">dernier <em>post</em> de blog</a> du réseau présente un guide pratique d’utilisation de ces données dans plusieurs langages de traitement (<i class="fa-brands fa-r-project" aria-label="r-project"></i> , <code>Python</code> <i class="fa-brands fa-python" aria-label="python"></i> et <code>Observable</code> <i class="fa-brands fa-js-square" aria-label="js-square"></i>) par le biais de <code>DuckDB</code>.</p>
<p>Combien d’habitants de Toulouse ont changé de logement sur l’année ? Quels sont les départements avec le plus de centenaires ? Le <a href="https://ssphub.netlify.app/post/parquetrp/"><em>post</em> de blog</a> vous montrera comment calculer ces statistiques. Et si vous désirez découvrir ce format avec des exemples additionnels, ce <em>post</em> d’<a href="https://www.icem7.fr/outils/3-explorations-bluffantes-avec-duckdb-1-interroger-des-fichiers-distants/">Eric Mauvière</a> vous intéressera également.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li>Le <a href="https://ssphub.netlify.app/post/parquetrp/"><em>post</em> de blog</a> ;</li>
<li>Un <a href="https://www.insee.fr/fr/information/7635827?sommaire=7635842">article</a> sur le format <code>Parquet</code> dans le <em>Courrier des stats n°9</em> écrit par Alexis Dondon et Pierre Lamarche ;</li>
<li>Le blog d’<a href="https://www.icem7.fr/outils/3-explorations-bluffantes-avec-duckdb-1-interroger-des-fichiers-distants/">Eric Mauvière</a> qui présente une série d’articles sur le format <code>Parquet</code>;</li>
<li>La <a href="https://www.linkedin.com/feed/update/urn:li:activity:7133760348129505281?updateEntityUrn=urn%3Ali%3Afs_feedUpdate%3A%28V2%2Curn%3Ali%3Aactivity%3A7133760348129505281%29">présentation</a> de Romain Lesur sur le sujet pour l’atelier <em>Modernisation of Official Statistics</em> de l’UNECE.</li>
</ul>
</div>
</div>
</section>
<section id="le-sspcloud-se-dote-dun-explorateur-de-fichiers-basé-sur-duckdb" class="level2">
<h2 class="anchored" data-anchor-id="le-sspcloud-se-dote-dun-explorateur-de-fichiers-basé-sur-duckdb">Le <a href="https://datalab.sspcloud.fr">SSPCloud</a> se dote d’un explorateur de fichiers basé sur <code>DuckDB</code></h2>
<p><code>DuckDB</code> est un outil extrêmement efficace pour lire des fichiers <code>Parquet</code> et <code>CSV</code>. Outre son efficacité, <code>DuckDB</code> présente l’avantage d’être disponible par le biais de plusieurs clients: <i class="fa-brands fa-r-project" aria-label="r-project"></i>, <code>Python</code> <i class="fa-brands fa-python" aria-label="python"></i> mais aussi un navigateur web grâce à <code>Javascript</code> <i class="fa-brands fa-js-square" aria-label="js-square"></i> . Des acteurs majeurs de l’écosystème de la <em>data science</em>, notamment <a href="https://observablehq.com/documentation/data/databases/database-clients#duckdb">Observable</a>, ont fait de <code>DuckDB</code> une pierre angulaire de leurs explorateurs de données. L’avantage de cette approche, typique du <a href="https://developer.mozilla.org/fr/docs/WebAssembly"><em>web assembly</em></a> (approche visant à mettre à disposition des logiciels de calculs scientifiques par le biais d’un simple navigateur), est que seul <code>Javascript</code> <i class="fa-brands fa-js-square" aria-label="js-square"></i>, qui est disponible sur tout navigateur, est nécessaire pour visualiser et effectuer des traitements analytiques sur des données.</p>
<p>Le <a href="https://datalab.sspcloud.fr"><code>SSPCloud</code></a>, la plateforme moderne de traitement de données développée par l’Insee et mise à disposition de près de 3000 agents de l’administration ou étudiants, vient de mettre en oeuvre <a href="https://datalab.sspcloud.fr/data-explorer?rowsPerPage=25&amp;page=1&amp;columnWidths=%7B%7D&amp;columnVisibility=%7B%7D">un explorateur</a> aux fonctionnalités similaires 🚀.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://ssphub.netlify.app/infolettre/infolettre_16/viewer-sspcloud.png" class="img-fluid figure-img"></p>
<figcaption>Un exemple d’utilisation de cet explorateur sur les données détaillées du recensement 👆️</figcaption>
</figure>
</div>
<p>Celui-ci s’appuie sur <code>DuckDB</code> et permet de visualiser de manière très fluide les fichiers aux formats <code>Parquet</code> et <code>CSV</code>. Il ne se restreint pas aux données disponibles sur les espaces de stockage personnels du <code>SSPCloud</code>: n’importe quel fichier, au format adéquat et disponible sur internet, peut être lu avec ce visualiseur. Il n’est d’ailleurs pas nécessaire d’avoir un compte sur le <a href="https://datalab.sspcloud.fr"><code>SSPCloud</code></a> pour l’utiliser, il suffit que le fichier que l’on souhaite lire soit un fichier <em>open data </em> 😍 !</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><a href="https://developer.mozilla.org/fr/docs/WebAssembly">Des éléments</a> sur le <em>web assembly</em> ;</li>
<li><a href="https://datalab.sspcloud.fr/data-explorer?rowsPerPage=25&amp;page=1&amp;columnWidths=%7B%7D&amp;columnVisibility=%7B%7D">L’explorateur de fichier du <code>SSPCloud</code></a> ;</li>
<li><a href="https://explore.data.gouv.fr/tableau">L’explorateur de fichiers de <code>data.gouv</code></a> basé sur la même approche technologique.</li>
</ul>
</div>
</div>
</section>
<section id="laccessibilité-de-jupyter-améliorée-avec-le-concours-de-linsee" class="level2">
<h2 class="anchored" data-anchor-id="laccessibilité-de-jupyter-améliorée-avec-le-concours-de-linsee">L’accessibilité de <code>Jupyter</code> améliorée avec le concours de l’Insee</h2>
<p>Afin de ne pas pénaliser certains publics, les logiciels doivent respecter des critères d’accessibilité. Ils doivent notamment avoir de nombreuses fonctionnalités accessibles sans souris, exclusivement par le biais du clavier. Cependant, <code>Jupyter</code>, logiciel bien connu des <em>data scientists</em>, par la structure complexe de son interface, présentait plusieurs défauts, comme la difficulté à naviguer dans la page pour trouver le menu nécessaire pour éditer du code.</p>
<p>Grâce à une subvention de l’Insee, des travaux d’amélioration de l’accessibilité de <code>Jupyter</code> ont pu être menés. Les prochaines versions du logiciel devraient être plus accessibles, et, entre autres, plus pratiques d’usage pour les <em>data scientists</em> qui privilégient le clavier à la souris pour se déplacer dans un document.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Pour en savoir plus
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li>L’<a href="https://blog.jupyter.org/recent-keyboard-navigation-improvements-in-jupyter-4df32f97628d">annonce</a> sur le blog de <code>Jupyter</code> ;</li>
<li>Le principe d’<a href="https://www.w3.org/WAI/WCAG21/Understanding/keyboard-accessible">accessibilité clavier</a> du W3C.</li>
</ul>
</div>
</div>
</section>
</section>
<section id="annexe-pour-les-curieux-le-code-observable-utilisé-pour-cette-page" class="level1">
<h1>Annexe pour les curieux: le code <code>Observable</code> utilisé pour cette page</h1>
<details>
<summary>
Les librairies ou imports externes utilisés
</summary>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="annotated-cell-17" data-startfrom="0" data-source-offset="-0" data-llms-code-original="Plot = require('@observablehq/plot@0.6.12/dist/plot.umd.min.js') //<1>
import {disposal} from &quot;@mbostock/disposal&quot;
import {Scrubber} from &quot;@mbostock/scrubber&quot;" style="background: #f1f3f5;"><pre class="sourceCode js code-annotation-code code-with-copy code-annotated"><code class="sourceCode javascript" style="counter-reset: source-line -1;"><button class="code-annotation-anchor" data-target-cell="annotated-cell-17" data-target-annotation="1">1</button><span id="annotated-cell-17-0" class="code-annotation-target">Plot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">require</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'@observablehq/plot@0.6.12/dist/plot.umd.min.js'</span>)</span>
<span id="annotated-cell-17-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> {disposal} <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"@mbostock/disposal"</span></span>
<span id="annotated-cell-17-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> {Scrubber} <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"@mbostock/scrubber"</span></span><div class="code-annotation-gutter-bg"></div><div class="code-annotation-gutter"></div></code></pre></div></div>
<div class="cell-annotation">
<dl class="code-annotation-container-hidden code-annotation-container-grid">
<dt data-target-cell="annotated-cell-17" data-target-annotation="1">1</dt>
<dd>
<span data-code-cell="annotated-cell-17" data-code-lines="0" data-code-annotation="1">La librairie <code>Plot</code> embarquée par défaut dans <code>Quarto</code> est un peu vieille mais la mettre à jour est assez simple.</span>
</dd>
</dl>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-10-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-10-2" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-10-3" data-nodetype="declaration">

</div>
</div>
</div>
</div>
</details>
<!-----------------
Objets temporaires
------------------>
<details>
<summary>
Objets réactifs nécessaires pour modifier en continu l’input de la figure 1
</summary>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb15--1">message <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb15-0">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> class_to_use <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (scrubber_participants <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> end_count <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blurred-element"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"underline-big"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb15-1"></span>
<span id="cb15-2">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> message_to_print <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb15-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  En fin d'année, &lt;span class = "</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>class_to_use<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" &gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>end_count<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/span&gt; personnes étaient membres de la liste de diffusion 🚀🚀.</span></span>
<span id="cb15-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  `</span></span>
<span id="cb15-5"></span>
<span id="cb15-6">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> message_to_print</span>
<span id="cb15-7">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-11" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb16--1">numbers2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb16-0">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> startValue <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> start_count<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb16-1">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> endValue <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> end_count<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb16-2"></span>
<span id="cb16-3">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> numbers <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">from</span>({ <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">length</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> endValue <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> startValue <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> }<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> (_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> i) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> startValue)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb16-4">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> numbers</span>
<span id="cb16-5">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-12" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb17--1">current_bar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb17-0">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> startValue <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb17-1">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> endValue <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> scrubber_participants<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb17-2"></span>
<span id="cb17-3">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> numbers <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">from</span>({ <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">length</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> endValue <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> startValue <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> }<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> (_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> i) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> startValue) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb17-4">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> numbers</span>
<span id="cb17-5"></span>
<span id="cb17-6">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-13" data-nodetype="declaration">

</div>
</div>
</div>
<!---------
scrubber
---------->
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb18" data-startfrom="0" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -1;"><span id="cb18-0">viewof scrubber_participants <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Scrubber</span>(numbers2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">loopDelay</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4000</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">initial</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> start_count})</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-14" data-nodetype="declaration">

</div>
</div>
</div>
</details>
<!------------ 
figure
------------->
<details>
<summary>
La première figure, animée par la réactivité de ses inputs
</summary>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="annotated-cell-22" data-startfrom="-1" data-source-offset="0" data-llms-code-original="plot_bar_participants = Plot.plot({
  height: 40,
  marginLeft: 60,
  x: {label: &quot;Frequency →&quot;, domain: [336, 552]},
  y: {label: null},
  color: {
    scheme: &quot;ylorrd&quot;,
    domain: [236, scrubber_participants] 
    },
  marks: [
    Plot.barX(current_bar, {x: 1, inset: 0.5, fill: (d) => d}),    //<1>
  ]
})" style="background: #f1f3f5;"><pre class="sourceCode js code-annotation-code code-with-copy code-annotated"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="annotated-cell-22--1">plot_bar_participants <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>({</span>
<span id="annotated-cell-22-0">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">height</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-22-1">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marginLeft</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-22-2">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Frequency →"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">domain</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">336</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">552</span>]}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-22-3">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">null</span>}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-22-4">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">color</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {</span>
<span id="annotated-cell-22-5">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">scheme</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ylorrd"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-22-6">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">domain</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">236</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> scrubber_participants] </span>
<span id="annotated-cell-22-7">    }<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-22-8">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marks</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<button class="code-annotation-anchor" data-target-cell="annotated-cell-22" data-target-annotation="1">1</button><span id="annotated-cell-22-9" class="code-annotation-target">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">barX</span>(current_bar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">inset</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fill</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> (d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> d})<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="annotated-cell-22-10">  ]</span>
<span id="annotated-cell-22-11">})</span><div class="code-annotation-gutter-bg"></div><div class="code-annotation-gutter"></div></code></pre></div></div>
<div class="cell-annotation">
<dl class="code-annotation-container-hidden code-annotation-container-grid">
<dt data-target-cell="annotated-cell-22" data-target-annotation="1">1</dt>
<dd>
<span data-code-cell="annotated-cell-22" data-code-lines="9" data-code-annotation="1">Elément réactif</span>
</dd>
</dl>
</div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-15" data-nodetype="declaration">

</div>
</div>
</div>
</details>
<details>
<summary>
Fonctions utilisées
</summary>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb19--1">dateFormat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">utcFormat</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%Y-%m-%d"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-16" data-nodetype="declaration">

</div>
</div>
</div>
<!----
Compter les événements du réseau
------>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb20--1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pluralizeEvent</span>(input) {</span>
<span id="cb20-0">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">switch</span> (input) {</span>
<span id="cb20-1">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">case</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Evénement virtuel ou présentiel"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span></span>
<span id="cb20-2">      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"événements virtuels ou présentiels"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb20-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">case</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Infolettre"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span></span>
<span id="cb20-4">      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"infolettres"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb20-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">case</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Post de blog"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span></span>
<span id="cb20-6">      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"posts de blog"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb20-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">case</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Masterclass"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span></span>
<span id="cb20-8">      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"masterclasses"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb20-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">default</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span></span>
<span id="cb20-10">      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unknown event type"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb20-11">  }</span>
<span id="cb20-12">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-17" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb21--1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">countEvents</span>(x){</span>
<span id="cb21-0"></span>
<span id="cb21-1">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> pluriel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pluralizeEvent</span>(x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb21-2"></span>
<span id="cb21-3">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> message <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb21-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;span style="border-bottom: solid 4px </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>color_mapping_events[x]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; margin-bottom: -2px;"&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>nombre_events<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">get</span>(x)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>pluriel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb21-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;/span&gt;</span></span>
<span id="cb21-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  `</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb21-7"></span>
<span id="cb21-8">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> message</span>
<span id="cb21-9">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-18" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb22--1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leftJoinArrays</span>(array1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> array2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> mean<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> deviation) {</span>
<span id="cb22-0">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> randomNoise <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">randomNormal</span>(mean<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> deviation)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb22-1"></span>
<span id="cb22-2">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Sort arrays by date</span></span>
<span id="cb22-3">  array1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>((a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> b) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb22-4">  array2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>((a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> b) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb22-5"></span>
<span id="cb22-6">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Perform left join</span></span>
<span id="cb22-7">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> result <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> array1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>((item1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> index) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> {</span>
<span id="cb22-8">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> matchingItem <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> array2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">find</span>((item2) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> item2[key] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">===</span> item1[key])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb22-9">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> noise <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> matchingItem <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">randomNoise</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb22-10">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> noisedMail <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> matchingItem <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?</span> matchingItem<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mail</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> noise <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">undefined</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb22-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> { <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">rowNumber</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> index <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">...</span>item1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">...</span>matchingItem<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> noisedMail }<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb22-12">  })<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb22-13"></span>
<span id="cb22-14">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> result<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb22-15">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-19" data-nodetype="declaration">

</div>
</div>
</div>
<!----
Manipulation de listes ou arrays
------>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb23--1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> accessor) {</span>
<span id="cb23-0">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">from</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Set</span>(accessor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?</span> data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>(accessor) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> data))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb23-1">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-20" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb24--1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">interpolateDates</span>(data) {</span>
<span id="cb24-0">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Sort the data by date</span></span>
<span id="cb24-1">  data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>((a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> b) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb24-2"></span>
<span id="cb24-3">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Create an array to store the interpolated data</span></span>
<span id="cb24-4">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> interpolatedData <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb24-5"></span>
<span id="cb24-6">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Loop through the data to interpolate values between dates</span></span>
<span id="cb24-7">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++</span>) {</span>
<span id="cb24-8">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> currentDate <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(data[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb24-9">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> nextDate <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(data[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb24-10">    </span>
<span id="cb24-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Calculate the difference in days between current and next date</span></span>
<span id="cb24-12">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> daysDiff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (nextDate <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> currentDate) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb24-13"></span>
<span id="cb24-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Calculate the daily increment</span></span>
<span id="cb24-15">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> dailyIncrement <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (data[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mail</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> data[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mail</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> daysDiff<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb24-16"></span>
<span id="cb24-17">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Interpolate values for each day between the current and next date</span></span>
<span id="cb24-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> daysDiff<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> j<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++</span>) {</span>
<span id="cb24-19">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> interpolatedDate <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(currentDate)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb24-20">      interpolatedDate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">setDate</span>(currentDate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">getDate</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> j)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb24-21">      </span>
<span id="cb24-22">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> interpolatedValue <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> data[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mail</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dailyIncrement<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb24-23"></span>
<span id="cb24-24">      interpolatedData<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">push</span>({</span>
<span id="cb24-25">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">date</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> interpolatedDate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">toISOString</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">split</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T'</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb24-26">        <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">mail</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Math</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(interpolatedValue)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Round to the nearest integer</span></span>
<span id="cb24-27">      })<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb24-28">    }</span>
<span id="cb24-29">  }</span>
<span id="cb24-30"></span>
<span id="cb24-31">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Add the last data point</span></span>
<span id="cb24-32">  interpolatedData<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">push</span>({</span>
<span id="cb24-33">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">date</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> data[data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb24-34">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">mail</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> data[data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mail</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb24-35">  })<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb24-36"></span>
<span id="cb24-37">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> interpolatedData<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb24-38">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-21" data-nodetype="declaration">

</div>
</div>
</div>
</details>
<details>
<summary>
<p><em>Inputs</em> pour <code>DuckDB</code> 🦆</p>
</summary>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" data-startfrom="0" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -1;"><span id="cb25-0">url_events <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`https://minio.lab.sspcloud.fr/ssphub/diffusion/website/2023-12-retrospective/events_orginazed_2023.json`</span></span>
<span id="cb25-1">url_latest <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s3://ssphub/diffusion/website/2023-12-retrospective/list_contacts_latest.parquet'</span></span>
<span id="cb25-2">url_hors_ssp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s3://ssphub/diffusion/website/2023-12-retrospective/series_part_ssp.parquet'</span></span>
<span id="cb25-3">url_latest2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s3://ssphub/diffusion/website/2023-12-retrospective/series_nombre_contact.parquet'</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-22-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-22-2" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-22-3" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-22-4" data-nodetype="declaration">

</div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" data-startfrom="0" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -1;"><span id="cb26-0">configuredClient <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb26-1">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> client <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> DuckDBClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">of</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb26-2">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> client<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sql</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb26-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    SET s3_endpoint='minio.lab.sspcloud.fr'</span></span>
<span id="cb26-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  `</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb26-5">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> client<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb26-6">}</span>
<span id="cb26-7"></span>
<span id="cb26-8">db <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb26-9">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb26-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE VIEW share_ssp AS </span></span>
<span id="cb26-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    SELECT * FROM read_parquet('</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>url_hors_ssp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">') ;</span></span>
<span id="cb26-12"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  `</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb26-13">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb26-14"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE VIEW latest AS </span></span>
<span id="cb26-15"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    SELECT * FROM read_parquet('</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>url_latest<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">') WHERE date &gt; '2023-01-01' ;</span></span>
<span id="cb26-16"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  `</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb26-17">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb26-18"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE VIEW serie AS </span></span>
<span id="cb26-19"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    SELECT * FROM read_parquet('</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>url_latest2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">') WHERE date &gt; '2023-01-01' ;</span></span>
<span id="cb26-20"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  `</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb26-21">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> configuredClient</span>
<span id="cb26-22">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-23-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-23-2" data-nodetype="declaration">

</div>
</div>
</div>
</div>
<div class="cell" data-eval="true">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" data-startfrom="1" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb27-1">serie_contacts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sql</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb27-2"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">SELECT date, CAST(SUM(mail) AS int) AS mail</span></span>
<span id="cb27-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">FROM serie</span></span>
<span id="cb27-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">GROUP BY date</span></span>
<span id="cb27-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb27-6">serie_contacts_domain <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sql</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb27-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">SELECT date, domain, CAST(mail AS int) AS mail</span></span>
<span id="cb27-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">FROM serie</span></span>
<span id="cb27-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-24-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-24-2" data-nodetype="declaration">

</div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb28--1">hors_ssp_data <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb28-0"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">SELECT * FROM share_ssp WHERE date in ('2023-12-09', '2023-01-10')</span></span>
<span id="cb28-1"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-25" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb29--1">events <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">json</span>(url_events)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-26" data-nodetype="declaration">

</div>
</div>
</div>
</details>
<details>
<summary>
<p><em>Arrays</em> intermédiaire</p>
</summary>
<!----
computed objects
------>
<details>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb30--1">serie_contacts_complete <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">interpolateDates</span>(serie_contacts)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-27" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb31--1">start_count <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> serie_contacts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>((d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dateFormat</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2023-01-10"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>((d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mail</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-28" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb32--1">end_count <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> serie_contacts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>((d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dateFormat</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2023-12-09"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>((d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mail</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-29" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" data-startfrom="0" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -1;"><span id="cb33-0">events_data_figure1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> events<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> events_chosen_figure1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">includes</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type</span>))</span>
<span id="cb33-1">events_data_figure1</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-30-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-30-2" data-nodetype="expression">

</div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb34--1">nombre_events <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rollup</span>(events<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> (D) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> (d) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-31" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" data-startfrom="0" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -1;"><span id="cb35-0">measured_dates <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`SELECT DISTINCT strftime(date, '%Y-%m-%d') AS date FROM serie`</span>)</span>
<span id="cb35-1">date_selected <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> measured_dates<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>(d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">date</span>)</span>
<span id="cb35-2">list_dates2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`SELECT DISTINCT strftime(date, '%Y-%m-%d') AS date FROM serie`</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-32-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-32-2" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-32-3" data-nodetype="declaration">

</div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" data-startfrom="0" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -1;"><span id="cb36-0">links_website_ssphub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb36-1">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> toto <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb36-2"></span>
<span id="cb36-3">    events_data_figure1_b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">forEach</span>(item <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> {</span>
<span id="cb36-4">    toto[item<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">event</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> item<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">href</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb36-5">    })<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb36-6"></span>
<span id="cb36-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> toto</span>
<span id="cb36-8">}</span>
<span id="cb36-9">links_website_ssphub</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-33-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-33-2" data-nodetype="expression">

</div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb37--1">events_data_figure1_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">leftJoinArrays</span>(events_data_figure1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> serie_contacts_complete<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"date"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-34" data-nodetype="declaration">

</div>
</div>
</div>
</details>
<details>
<summary>
Quelques <em>array</em> utiles
</summary>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb38--1">color_mapping_events <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb38-0"></span>
<span id="cb38-1">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> color_mapping_events <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb38-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Evénement virtuel ou présentiel"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#4d78a6"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb38-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Infolettre"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#f28e2c"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb38-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Post de blog"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#e05658"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb38-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Masterclass"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#76b7b1"</span></span>
<span id="cb38-6">    }<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb38-7"></span>
<span id="cb38-8">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> color_mapping_events</span>
<span id="cb38-9">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-35" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb39" data-startfrom="-1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line -2;"><span id="cb39--1">dates_2023 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Array</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">from</span>({<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">length</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">365</span>}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> (_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> i) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> {</span>
<span id="cb39-0">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> date <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">new</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Date</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2023</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb39-1">  date<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">setDate</span>(i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb39-2">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> date<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb39-3">})</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-36" data-nodetype="declaration">

</div>
</div>
</div>
</details>


</details></section>

 ]]></description>
  <category>Infolettre</category>
  <guid>https://ssphub.netlify.app/infolettre/infolettre_16/</guid>
  <pubDate>Thu, 21 Dec 2023 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/infolettre/infolettre_16/santa.png" medium="image" type="image/png" height="144" width="144"/>
</item>
<item>
  <title>Guide d’utilisation des données du recensement de la population au format Parquet</title>
  <link>https://ssphub.netlify.app/post/parquetRP/</link>
  <description><![CDATA[ 





<p>Ce guide présente quelques exemples d’utilisation des données du recensement de la population diffusées au format <code>Parquet</code>. Il s’agit d’une version HTML enrichissant le guide publié sur le site <a href="https://www.insee.fr/fr/statistiques/7637890">insee.fr</a> pour les langages <code>Python</code> <i class="fa-brands fa-python" aria-label="python"></i> et <i class="fa-brands fa-r-project" aria-label="r-project"></i> avec des exemples interactifs pouvant être construits par le biais de <code>Quarto Markdown</code> et <code>Observable</code>.</p>
<p>L’ensemble des codes utilisés pour produire cette note est disponible sur le dépôt <a href="https://github.com/InseeFrLab/exemples-recensement-parquet"><code>Github</code> <i class="fa-brands fa-github" aria-label="github"></i> InseeFrLab/exemples-recensement-parquet</a> au format <a href="https://quarto.org/"><code>Quarto Markdown</code></a>.</p>
<p>Pour plus d’informations sur le format <code>Parquet</code>, dans un contexte de statistique publique, se référer à <span class="citation" data-cites="dondon-lamarche-2023">Dondon et Lamarche (2023)</span>. Pour un exemple sur la différence entre format <code>CSV</code> et <code>Parquet</code> illustré sur les données du recensement de la population, voir <span class="citation" data-cites="mauviere-2022">Mauvière (2022)</span>.</p>
<p>Ce guide propose d’utiliser <a href="https://duckdb.org/"><code>DuckDB</code></a> à travers plusieurs langages pour effectuer des traitements sur les fichiers détails du recensement. Par rapport à d’autres approches, <a href="https://duckdb.org/"><code>DuckDB</code></a> a été choisi pour son efficacité ainsi que pour son universalité<sup>1</sup>.</p>
<details>
<summary>
Afficher le dictionnaire des variables
</summary>
<p>Il est possible de rechercher dans la documentation des noms de variables ou des informations dans les descriptions. Lorsqu’une variable présente de nombreuses modalités, seules la première est la dernière sont retournées. Un exemple ci-dessous montre comment utiliser une requête SQL pour récupérer l’ensemble des valeurs d’une telle variable.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb1" data-startfrom="68" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 67;"><span id="cb1-68">viewof unique_description_filter <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">search</span>(</span>
<span id="cb1-69">  documentation<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {</span>
<span id="cb1-70">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">placeholder</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Trouver une information dans la documentation"</span></span>
<span id="cb1-71">  }</span>
<span id="cb1-72">  )</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb2" data-startfrom="77" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 76;"><span id="cb2-77">table_filtre_description <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb2-78">  unique_description_filter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-79">  {</span>
<span id="cb2-80">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">header</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {</span>
<span id="cb2-81">      <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">description_variable</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Description de la variable"</span></span>
<span id="cb2-82">    }    </span>
<span id="cb2-83">  }</span>
<span id="cb2-84">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-2" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb3" data-startfrom="89" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 88;"><span id="cb3-89">documentation <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`SELECT * FROM documentation_indiv`</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-3" data-nodetype="declaration">

</div>
</div>
</div>
</details>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>Ce <em>post</em> accompagne la mise à disposition des données du recensement de la population au format <code>Parquet</code> sur le site <a href="https://www.insee.fr/fr/statistiques/7706119?sommaire=7637890">insee.fr</a>.</p>
<p>Il vise à fournir une expérience plus ergonomique et des exemples supplémentaires liés au langage <code>Javascript</code> au guide PDF disponible sur la page du site <a href="https://www.insee.fr/fr/statistiques/7706119?sommaire=7637890">insee.fr</a>.</p>
<p>⚠️ Cette page s’appuie sur l’exploitation de données qui sont préalablement téléchargées de manière automatique par le navigateur <em>web</em>. Celles-ci représentent une volumétrie autour de 1Go, ce qui peut nécessiter un certain temps en fonction de la bande passante. Une fois téléchargées, l’exploitation de ces données nécessite néanmoins beaucoup moins de ressources grâce à l’optimisation permise par <code>DuckDB</code>.</p>
</div>
</div>
<section id="initialisation" class="level1">
<h1>Initialisation</h1>
<p>Les données sont disponibles sur le site <code>data.gouv</code> aux adresses suivantes :</p>
<ul>
<li><a href="https://www.insee.fr/fr/statistiques/7706119?sommaire=7637890">Fichier détail individuel</a> ;</li>
<li><a href="https://www.insee.fr/fr/statistiques/7705908?sommaire=7637890">Fichier détail logement</a>.</li>
</ul>
<p>Dans la suite de ce guide, il sera fait l’hypothèse pour <code>Python</code> et <code>R</code> que les données sont récupérées depuis les URL stables, enregistrées dans un même dossier et qu’il existe une variable <em>ad hoc</em> enregistrant ce chemin dans <code>Python</code> ou <code>R</code>. En ce qui concerne <code>Observable</code>, il est proposé d’utiliser directement l’URL de mise à disposition des fichiers.</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-1-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-1" aria-controls="tabset-1-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-1-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-2" aria-controls="tabset-1-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-1-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-3" aria-controls="tabset-1-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-1-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-1-4" aria-controls="tabset-1-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-1-1" class="tab-pane active" aria-labelledby="tabset-1-1-tab">
<p>Les URL stables de mise à dispositon des données seront directement renseignées dans la création de la base de données.</p>
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-2-contents" aria-controls="callout-2" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Mise en garde</span>Emplacement des données pour les exemples <code>Observable</code>
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-2" class="callout-2-contents callout-collapse collapse">
<div class="callout-body-container callout-body">
<p>En ce qui concerne <code>Observable</code>, il est proposé d’utiliser directement l’URL de mise à disposition des fichiers car l’extension <code>httpfs</code> est nativement intégrée à la librairie <code>DuckDB</code>, <em>a contrario</em> des clients <code>Python</code> et <code>R</code>.</p>
<p>Ces jeux de données sont automatiquement téléchargés par le navigateur et mis en <em>cache</em> pour accélérer des utilisations ultérieures de la page. Le premier chargement de tous les tableaux et graphiques sur celle-ci peut ainsi prendre un peu plus de temps.</p>
</div>
</div>
</div>
</div>
<div id="tabset-1-2" class="tab-pane" aria-labelledby="tabset-1-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1">path_data <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'C:/MesDocuments/dossierpersonnel'</span></span>
<span id="cb4-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># remplacer par l'emplacement où sont stockées </span></span>
<span id="cb4-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># les données</span></span></code></pre></div></div>
</div>
<div id="tabset-1-3" class="tab-pane" aria-labelledby="tabset-1-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">path_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'C:/MesDocuments/dossierpersonnel'</span></span>
<span id="cb5-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># remplacer par l'emplacement où sont stockées </span></span>
<span id="cb5-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># les données</span></span></code></pre></div></div>
</div>
<div id="tabset-1-4" class="tab-pane" aria-labelledby="tabset-1-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">path_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'C:/MesDocuments/dossierpersonnel'</span></span>
<span id="cb6-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># remplacer par l'emplacement où sont stockées </span></span>
<span id="cb6-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># les données</span></span></code></pre></div></div>
</div>
</div>
</div>
<p>Il est proposé, pour initialiser la connexion entre les données <code>Parquet</code> et le langage client (<code>Javascript</code>, <code>R</code> ou <code>Python</code>) d’utiliser des vues. Ceci permet de faire référence de manière répétée à la même source de données par le biais d’un alias (<code>table_logement</code> ou <code>table_individu</code>).</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-2-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-2-1" aria-controls="tabset-2-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-2-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-2-2" aria-controls="tabset-2-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-2-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-2-3" aria-controls="tabset-2-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-2-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-2-4" aria-controls="tabset-2-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-2-1" class="tab-pane active" aria-labelledby="tabset-2-1-tab">
<details>
<summary>
Dérouler pour découvrir le code <code>Observable</code> d’initialisation de la base de données avec <code>DuckDB</code>
</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb7-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb7-2">url_table_logement <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://www.data.gouv.fr/fr/datasets/r/f314175a-6d33-4ee4-b5eb-2cb6c29df2c2"</span></span>
<span id="cb7-3">url_table_individu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://www.data.gouv.fr/fr/datasets/r/c8e1b241-75fe-43e9-a266-830fc30ec61d"</span></span>
<span id="cb7-4">url_doc_logement <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://www.data.gouv.fr/fr/datasets/r/c274705f-98db-4d9b-9674-578e04f03198"</span></span>
<span id="cb7-5">url_doc_individu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://www.data.gouv.fr/fr/datasets/r/1c6c6ab2-b766-41a4-90f0-043173d5e9d1"</span></span>
<span id="cb7-6"></span>
<span id="cb7-7">renommage_documentation <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`SELECT </span></span>
<span id="cb7-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  COD_VAR AS nom_variable, </span></span>
<span id="cb7-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  LIB_VAR AS description_variable, </span></span>
<span id="cb7-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  TYPE_VAR AS type_variable, </span></span>
<span id="cb7-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  COD_MOD AS code_modalite, </span></span>
<span id="cb7-12"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  LIB_MOD AS description_modalite,</span></span>
<span id="cb7-13"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  LONG_VAR as longueur_variable`</span></span>
<span id="cb7-14"></span>
<span id="cb7-15">db <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb7-16">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> configuredClient <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> DuckDBClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">of</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb7-17"></span>
<span id="cb7-18">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb7-19"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE OR REPLACE VIEW table_individu </span></span>
<span id="cb7-20"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    AS SELECT *</span></span>
<span id="cb7-21"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    FROM read_parquet('</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>url_table_individu<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">')`</span></span>
<span id="cb7-22">  ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb7-23"></span>
<span id="cb7-24">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb7-25"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE OR REPLACE VIEW table_logement </span></span>
<span id="cb7-26"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    AS SELECT *</span></span>
<span id="cb7-27"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    FROM read_parquet('</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>url_table_logement<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">')`</span></span>
<span id="cb7-28">  ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb7-29"></span>
<span id="cb7-30">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb7-31"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE OR REPLACE VIEW documentation_logement</span></span>
<span id="cb7-32"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    AS </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>renommage_documentation<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> FROM read_csv_auto('</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>url_doc_logement<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">', header=true)`</span></span>
<span id="cb7-33">  ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb7-34">  </span>
<span id="cb7-35">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb7-36"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE OR REPLACE VIEW documentation_indiv</span></span>
<span id="cb7-37"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    AS </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>renommage_documentation<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> FROM read_csv_auto('</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>url_doc_individu<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">', header=true)`</span></span>
<span id="cb7-38">  ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb7-39"></span>
<span id="cb7-40">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> configuredClient</span>
<span id="cb7-41">}</span>
<span id="cb7-42"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb8" data-startfrom="248" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 247;"><span id="cb8-248">url_table_logement <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://static.data.gouv.fr/resources/recensement-de-la-population-fichiers-detail-logements-ordinaires-en-2020-1/20231023-123618/fd-logemt-2020.parquet"</span></span>
<span id="cb8-249">url_table_individu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://static.data.gouv.fr/resources/recensement-de-la-population-fichiers-detail-individus-localises-au-canton-ou-ville-2020-1/20231023-122841/fd-indcvi-2020.parquet"</span></span>
<span id="cb8-250">url_doc_logement <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://www.data.gouv.fr/fr/datasets/r/c274705f-98db-4d9b-9674-578e04f03198"</span></span>
<span id="cb8-251">url_doc_individu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://www.data.gouv.fr/fr/datasets/r/1c6c6ab2-b766-41a4-90f0-043173d5e9d1"</span></span>
<span id="cb8-252"></span>
<span id="cb8-253">renommage_documentation <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`SELECT </span></span>
<span id="cb8-254"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  COD_VAR AS nom_variable, </span></span>
<span id="cb8-255"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  LIB_VAR AS description_variable, </span></span>
<span id="cb8-256"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  TYPE_VAR AS type_variable, </span></span>
<span id="cb8-257"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  COD_MOD AS code_modalite, </span></span>
<span id="cb8-258"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  LIB_MOD AS description_modalite,</span></span>
<span id="cb8-259"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  LONG_VAR as longueur_variable`</span></span>
<span id="cb8-260"></span>
<span id="cb8-261">db <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb8-262">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> configuredClient <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> DuckDBClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">of</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb8-263"></span>
<span id="cb8-264">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb8-265"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE OR REPLACE VIEW table_individu </span></span>
<span id="cb8-266"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    AS SELECT *</span></span>
<span id="cb8-267"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    FROM read_parquet('</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>url_table_individu<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">')`</span></span>
<span id="cb8-268">  ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb8-269"></span>
<span id="cb8-270">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb8-271"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE OR REPLACE VIEW table_logement </span></span>
<span id="cb8-272"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    AS SELECT *</span></span>
<span id="cb8-273"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    FROM read_parquet('</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>url_table_logement<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">')`</span></span>
<span id="cb8-274">  ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb8-275">  </span>
<span id="cb8-276">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb8-277"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE OR REPLACE VIEW documentation_indiv</span></span>
<span id="cb8-278"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    AS </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>renommage_documentation<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> FROM read_csv_auto('</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>url_doc_individu<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">', header=true)`</span></span>
<span id="cb8-279">  ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb8-280"></span>
<span id="cb8-281">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb8-282"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE OR REPLACE VIEW documentation_logement</span></span>
<span id="cb8-283"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    AS </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>renommage_documentation<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> FROM read_csv_auto('</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>url_doc_logement<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">', header=true)`</span></span>
<span id="cb8-284">  ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb8-285"></span>
<span id="cb8-286">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> configuredClient</span>
<span id="cb8-287">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-4-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-4-2" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-4-3" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-4-4" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-4-5" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-4-6" data-nodetype="declaration">

</div>
</div>
</div>
</div>
</details>
</div>
<div id="tabset-2-2" class="tab-pane" aria-labelledby="tabset-2-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> duckdb</span>
<span id="cb9-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os</span>
<span id="cb9-3"></span>
<span id="cb9-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> os.path.isdir(path_data):</span>
<span id="cb9-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"path_data n'est pas un répertoire valide."</span>)</span>
<span id="cb9-6"></span>
<span id="cb9-7">duckdb.sql(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'''</span></span>
<span id="cb9-8"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  CREATE OR REPLACE VIEW table_individu</span></span>
<span id="cb9-9"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  AS SELECT * FROM read_parquet("</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>path_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/FD_INDCVI_2020.parquet")</span></span>
<span id="cb9-10"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'''</span></span>
<span id="cb9-11">)</span>
<span id="cb9-12"></span>
<span id="cb9-13">duckdb.sql(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'''</span></span>
<span id="cb9-14"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  CREATE OR REPLACE VIEW table_logement</span></span>
<span id="cb9-15"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  AS SELECT * FROM read_parquet("</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>path_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/FD_LOGEMT_2020.parquet")</span></span>
<span id="cb9-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'''</span></span>
<span id="cb9-17">)</span>
<span id="cb9-18"></span>
<span id="cb9-19">duckdb.sql(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'''</span></span>
<span id="cb9-20"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  CREATE OR REPLACE VIEW documentation_indiv</span></span>
<span id="cb9-21"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  AS SELECT COD_VAR AS nom_variable,</span></span>
<span id="cb9-22"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     LIB_VAR AS description_variable,</span></span>
<span id="cb9-23"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     TYPE_VAR AS type_variable,</span></span>
<span id="cb9-24"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     COD_MOD AS code_modalite,</span></span>
<span id="cb9-25"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     LIB_MOD AS description_modalite,</span></span>
<span id="cb9-26"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     LONG_VAR as longueur_variable</span></span>
<span id="cb9-27"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  FROM read_csv_auto("</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>path_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/dictionnaire_variables_indcvi_2020.csv", header=true)</span></span>
<span id="cb9-28"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'''</span></span>
<span id="cb9-29">)</span>
<span id="cb9-30"></span>
<span id="cb9-31">duckdb.sql(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'''</span></span>
<span id="cb9-32"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  CREATE OR REPLACE VIEW documentation_logement</span></span>
<span id="cb9-33"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  AS SELECT COD_VAR AS nom_variable,</span></span>
<span id="cb9-34"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     LIB_VAR AS description_variable,</span></span>
<span id="cb9-35"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     TYPE_VAR AS type_variable,</span></span>
<span id="cb9-36"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     COD_MOD AS code_modalite,</span></span>
<span id="cb9-37"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     LIB_MOD AS description_modalite,</span></span>
<span id="cb9-38"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     LONG_VAR as longueur_variable</span></span>
<span id="cb9-39"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  FROM read_csv_auto("</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>path_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/dictionnaire_variables_logemt_2020.csv", header=true)</span></span>
<span id="cb9-40"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'''</span></span>
<span id="cb9-41">)</span></code></pre></div></div>
</div>
<div id="tabset-2-3" class="tab-pane" aria-labelledby="tabset-2-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(duckdb)</span>
<span id="cb10-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(glue)</span>
<span id="cb10-3"></span>
<span id="cb10-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Pour créer une base de données en mémoire</span></span>
<span id="cb10-5">con <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbConnect</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">duckdb</span>())</span>
<span id="cb10-6"></span>
<span id="cb10-7">path_data_sql <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> DBI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">SQL</span>(path_data)</span>
<span id="cb10-8"></span>
<span id="cb10-9"></span>
<span id="cb10-10">renommage_documentation <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span>  DBI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">SQL</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(</span>
<span id="cb10-11"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT"</span>,</span>
<span id="cb10-12"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"COD_VAR AS nom_variable,"</span>,</span>
<span id="cb10-13"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LIB_VAR AS description_variable,"</span>,</span>
<span id="cb10-14"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TYPE_VAR AS type_variable,"</span>,</span>
<span id="cb10-15"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"COD_MOD AS code_modalite,"</span>,</span>
<span id="cb10-16"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LIB_MOD AS description_modalite,"</span>,</span>
<span id="cb10-17"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LONG_VAR as longueur_variable"</span></span>
<span id="cb10-18">))</span>
<span id="cb10-19"></span>
<span id="cb10-20"></span>
<span id="cb10-21"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbExecute</span>(</span>
<span id="cb10-22">  con,</span>
<span id="cb10-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql</span>(  </span>
<span id="cb10-24">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CREATE OR REPLACE VIEW table_individu AS '</span>,</span>
<span id="cb10-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'SELECT * FROM read_parquet("{path_data_sql}/FD_INDCVI_2020.parquet")'</span>,</span>
<span id="cb10-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.con=</span>con</span>
<span id="cb10-27">  )</span>
<span id="cb10-28">)</span>
<span id="cb10-29"></span>
<span id="cb10-30"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbExecute</span>(</span>
<span id="cb10-31">  con,</span>
<span id="cb10-32">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql</span>(  </span>
<span id="cb10-33">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CREATE OR REPLACE VIEW table_logement AS '</span>,</span>
<span id="cb10-34">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'SELECT * FROM read_parquet("{path_data_sql}/FD_LOGEMT_2020.parquet")'</span>,</span>
<span id="cb10-35">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.con=</span>con</span>
<span id="cb10-36">  )</span>
<span id="cb10-37">)</span>
<span id="cb10-38"></span>
<span id="cb10-39"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbExecute</span>(</span>
<span id="cb10-40">  con,</span>
<span id="cb10-41">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql</span>(</span>
<span id="cb10-42">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CREATE OR REPLACE VIEW documentation_indiv AS '</span>,</span>
<span id="cb10-43">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'{renommage_documentation} FROM '</span>,</span>
<span id="cb10-44">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'read_csv_auto("{path_data_sql}/dictionnaire_variables_indcvi_2020.csv", header=true)'</span>,</span>
<span id="cb10-45">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.con=</span>con</span>
<span id="cb10-46">  )</span>
<span id="cb10-47">)</span>
<span id="cb10-48"></span>
<span id="cb10-49"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbExecute</span>(</span>
<span id="cb10-50">  con,</span>
<span id="cb10-51">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql</span>(</span>
<span id="cb10-52">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CREATE OR REPLACE VIEW documentation_logement AS '</span>,</span>
<span id="cb10-53">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'{renommage_documentation} FROM '</span>,</span>
<span id="cb10-54">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'read_csv_auto("{path_data_sql}/dictionnaire_variables_logemt_2020.csv", header=true)'</span>,</span>
<span id="cb10-55">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.con=</span>con</span>
<span id="cb10-56">  )</span>
<span id="cb10-57">)</span></code></pre></div></div>
</div>
<div id="tabset-2-4" class="tab-pane" aria-labelledby="tabset-2-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(duckdb)</span>
<span id="cb11-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(dplyr)</span>
<span id="cb11-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(stringr)</span>
<span id="cb11-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(glue)</span>
<span id="cb11-5"></span>
<span id="cb11-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Pour créer une base de données en mémoire</span></span>
<span id="cb11-7">con <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbConnect</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">duckdb</span>())</span>
<span id="cb11-8"></span>
<span id="cb11-9">path_data_sql <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> DBI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">SQL</span>(path_data)</span>
<span id="cb11-10"></span>
<span id="cb11-11">renommage_documentation <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span>  DBI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">SQL</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(</span>
<span id="cb11-12"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT"</span>,</span>
<span id="cb11-13"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"COD_VAR AS nom_variable,"</span>,</span>
<span id="cb11-14"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LIB_VAR AS description_variable,"</span>,</span>
<span id="cb11-15"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TYPE_VAR AS type_variable,"</span>,</span>
<span id="cb11-16"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"COD_MOD AS code_modalite,"</span>,</span>
<span id="cb11-17"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LIB_MOD AS description_modalite,"</span>,</span>
<span id="cb11-18"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LONG_VAR as longueur_variable"</span></span>
<span id="cb11-19">))</span>
<span id="cb11-20"></span>
<span id="cb11-21"></span>
<span id="cb11-22"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbExecute</span>(</span>
<span id="cb11-23">  con,</span>
<span id="cb11-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql</span>(  </span>
<span id="cb11-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CREATE OR REPLACE VIEW table_individu AS '</span>,</span>
<span id="cb11-26">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'SELECT * FROM read_parquet("{path_data_sql}/FD_INDCVI_2020.parquet")'</span>,</span>
<span id="cb11-27">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.con=</span>con</span>
<span id="cb11-28">  )</span>
<span id="cb11-29">)</span>
<span id="cb11-30"></span>
<span id="cb11-31">table_individu <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tbl</span>(con, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table_individu"</span>)</span>
<span id="cb11-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># La requête pourrait aussi s'écrire directement dans l'appel à tbl :</span></span>
<span id="cb11-33">table_individu_direct <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tbl</span>(con, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'read_parquet("{path_data}/FD_INDCVI_2020.parquet")'</span>))</span>
<span id="cb11-34"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(table_individu_direct)</span>
<span id="cb11-35"></span>
<span id="cb11-36"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbExecute</span>(</span>
<span id="cb11-37">  con,</span>
<span id="cb11-38">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql</span>(  </span>
<span id="cb11-39">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CREATE OR REPLACE VIEW table_logement AS '</span>,</span>
<span id="cb11-40">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'SELECT * FROM read_parquet("{path_data_sql}/FD_LOGEMT_2020.parquet")'</span>,</span>
<span id="cb11-41">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.con=</span>con</span>
<span id="cb11-42">  )</span>
<span id="cb11-43">)</span>
<span id="cb11-44">table_logement <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tbl</span>(con, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table_logement"</span>)</span>
<span id="cb11-45"></span>
<span id="cb11-46"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbExecute</span>(</span>
<span id="cb11-47">  con,</span>
<span id="cb11-48">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql</span>(</span>
<span id="cb11-49">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CREATE OR REPLACE VIEW documentation_indiv AS '</span>,</span>
<span id="cb11-50">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'{renommage_documentation} FROM '</span>,</span>
<span id="cb11-51">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'read_csv_auto("{path_data_sql}/dictionnaire_variables_indcvi_2020.csv", header=true)'</span>,</span>
<span id="cb11-52">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.con=</span>con</span>
<span id="cb11-53">  )</span>
<span id="cb11-54">)</span>
<span id="cb11-55">documentation_indiv <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tbl</span>(con, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"documentation_indiv"</span>)</span>
<span id="cb11-56"></span>
<span id="cb11-57"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbExecute</span>(</span>
<span id="cb11-58">  con,</span>
<span id="cb11-59">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql</span>(</span>
<span id="cb11-60">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CREATE OR REPLACE VIEW documentation_logement AS '</span>,</span>
<span id="cb11-61">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'{renommage_documentation} FROM '</span>,</span>
<span id="cb11-62">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'read_csv_auto("{path_data_sql}/dictionnaire_variables_logemt_2020.csv", header=true)'</span>,</span>
<span id="cb11-63">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.con=</span>con</span>
<span id="cb11-64">  )</span>
<span id="cb11-65">)</span>
<span id="cb11-66">documentation_logement <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tbl</span>(con, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"documentation_logement"</span>)</span></code></pre></div></div>
</div>
</div>
</div>
<p>Pour rapidement avoir une idée des informations présentes dans ces données, le code ci-dessous peut être utilisé :</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-3-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-3-1" aria-controls="tabset-3-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-3-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-3-2" aria-controls="tabset-3-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-3-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-3-3" aria-controls="tabset-3-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-3-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-3-4" aria-controls="tabset-3-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-3-1" class="tab-pane active" aria-labelledby="tabset-3-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb12-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb12-2">schema_table_logement <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb12-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_logement"</span></span>
<span id="cb12-4">  )</span>
<span id="cb12-5">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(documentation_logement)</span>
<span id="cb12-6"></span>
<span id="cb12-7">schema_table_individu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb12-8">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_indiv"</span></span>
<span id="cb12-9">  )</span>
<span id="cb12-10">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(schema_table_individu)</span>
<span id="cb12-11"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-3-2" class="tab-pane" aria-labelledby="tabset-3-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1">schema_table_individu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> duckdb.sql(</span>
<span id="cb13-2">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_indiv"</span></span>
<span id="cb13-3">  ).to_df()</span>
<span id="cb13-4">display(schema_table_individu.head(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb13-5"></span>
<span id="cb13-6">schema_table_logement <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> duckdb.sql(</span>
<span id="cb13-7">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_logement"</span></span>
<span id="cb13-8">  ).to_df()</span>
<span id="cb13-9">display(schema_table_logement.head(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span></code></pre></div></div>
</div>
<div id="tabset-3-3" class="tab-pane" aria-labelledby="tabset-3-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">schema_table_individu <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(</span>
<span id="cb14-2">  con,</span>
<span id="cb14-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_indiv"</span></span>
<span id="cb14-4">)</span>
<span id="cb14-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(schema_table_individu))</span>
<span id="cb14-6"></span>
<span id="cb14-7">schema_table_logement <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(</span>
<span id="cb14-8">  con,</span>
<span id="cb14-9">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_logement"</span></span>
<span id="cb14-10">)</span>
<span id="cb14-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(schema_table_logement))</span></code></pre></div></div>
</div>
<div id="tabset-3-4" class="tab-pane" aria-labelledby="tabset-3-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1"></span>
<span id="cb15-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(documentation_indiv))</span>
<span id="cb15-3"></span>
<span id="cb15-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">print</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(documentation_logement))</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb16" data-startfrom="260" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 259;"><span id="cb16-260">schema_table_individu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb16-261">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_indiv"</span></span>
<span id="cb16-262">  )</span>
<span id="cb16-263">schema_table_logement <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb16-264">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_logement"</span></span>
<span id="cb16-265">  )</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-5-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-5-2" data-nodetype="declaration">

</div>
</div>
</div>
</div>
<p>Voici le dictionnaire des variables de la table logement:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb17" data-startfrom="266" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 265;"><span id="cb17-266">viewof search_logement <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">search</span>(schema_table_logement<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {</span>
<span id="cb17-267">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">placeholder</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rechercher une information dans la table logement"</span></span>
<span id="cb17-268">})</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-6" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb18" data-startfrom="273" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 272;"><span id="cb18-273">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(search_logement)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-7" data-nodetype="expression">

</div>
</div>
</div>
<p>Et voici celui de la table individus:</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb19" data-startfrom="280" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 279;"><span id="cb19-280">viewof search_individus <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">search</span>(schema_table_individu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {</span>
<span id="cb19-281">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">placeholder</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rechercher une information dans la table individus"</span></span>
<span id="cb19-282">})</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-8" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb20" data-startfrom="316" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 315;"><span id="cb20-316">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(search_individus)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-9" data-nodetype="expression">

</div>
</div>
</div>
<p>Pour découvrir les informations présentes dans la base, il est possible d’utiliser les fonctions pré-implémentées de <code>DuckDB</code> pour la <a href="https://duckdb.org/docs/sql/functions/char.html">manipulation de données textuelles</a>. Par exemple, pour extraire toutes les modalités des variables dont la description contient le terme <em>“catégorie”</em> :</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-4-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-4-1" aria-controls="tabset-4-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-4-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-4-2" aria-controls="tabset-4-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-4-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-4-3" aria-controls="tabset-4-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-4-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-4-4" aria-controls="tabset-4-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-4-1" class="tab-pane active" aria-labelledby="tabset-4-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb21-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb21-2">query <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_logement WHERE CONTAINS(description_variable, 'Catégorie')"</span></span>
<span id="cb21-3">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb21-4">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(query)</span>
<span id="cb21-5">)</span>
<span id="cb21-6"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-4-2" class="tab-pane" aria-labelledby="tabset-4-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb22-1">query <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_logement WHERE CONTAINS(description_variable, 'Catégorie')"</span></span>
<span id="cb22-2">duckdb.sql(query)</span></code></pre></div></div>
</div>
<div id="tabset-4-3" class="tab-pane" aria-labelledby="tabset-4-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1">query <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_logement WHERE CONTAINS(description_variable, 'Catégorie')"</span></span>
<span id="cb23-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(con, query)</span></code></pre></div></div>
</div>
<div id="tabset-4-4" class="tab-pane" aria-labelledby="tabset-4-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1">documentation_logement <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb24-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(description_variable, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catégorie"</span>))</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb25" data-startfrom="351" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 350;"><span id="cb25-351">query <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_logement WHERE CONTAINS(description_variable, 'Catégorie')"</span></span>
<span id="cb25-352">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb25-353">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(query)</span>
<span id="cb25-354">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-10-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-10-2" data-nodetype="expression">

</div>
</div>
</div>
</div>
<p>Cette approche peut permettre de récupérer les modalités d’une variable. Dans cette base de données, les valeurs <code>Z</code> sont à part. Il est possible d’avoir du détail sur celles-ci avec la requête suivante :</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-5-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-5-1" aria-controls="tabset-5-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-5-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-5-2" aria-controls="tabset-5-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-5-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-5-3" aria-controls="tabset-5-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-5-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-5-4" aria-controls="tabset-5-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-5-1" class="tab-pane active" aria-labelledby="tabset-5-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb26-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb26-2">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb26-3">  db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb26-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_indiv WHERE CONTAINS(code_modalite, 'Z')"</span></span>
<span id="cb26-5">  )<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb26-6">  {</span>
<span id="cb26-7">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">columns</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="cb26-8">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nom_variable"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"code_modalite"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb26-9">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"description_modalite"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"description_variable"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb26-10">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"type_variable"</span></span>
<span id="cb26-11">      ]</span>
<span id="cb26-12">  }</span>
<span id="cb26-13">)</span>
<span id="cb26-14"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-5-2" class="tab-pane" aria-labelledby="tabset-5-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb27-1">duckdb.sql(</span>
<span id="cb27-2">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_indiv WHERE CONTAINS(code_modalite, 'Z')"</span></span>
<span id="cb27-3">)</span></code></pre></div></div>
</div>
<div id="tabset-5-3" class="tab-pane" aria-labelledby="tabset-5-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1">query <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_indiv WHERE CONTAINS(code_modalite, 'Z')"</span></span>
<span id="cb28-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(con, query)</span></code></pre></div></div>
</div>
<div id="tabset-5-4" class="tab-pane" aria-labelledby="tabset-5-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">documentation_indiv <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb29-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(code_modalite, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z"</span>))</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb30" data-startfrom="397" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 396;"><span id="cb30-397">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb30-398">  db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb30-399">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM documentation_indiv WHERE CONTAINS(code_modalite, 'Z')"</span></span>
<span id="cb30-400">  )<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb30-401">  {</span>
<span id="cb30-402">    <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">columns</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="cb30-403">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nom_variable"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"code_modalite"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb30-404">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"description_modalite"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"description_variable"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb30-405">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"type_variable"</span></span>
<span id="cb30-406">      ]</span>
<span id="cb30-407">  }</span>
<span id="cb30-408">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-11" data-nodetype="expression">

</div>
</div>
</div>
</section>
<section id="lecture-et-affichage-de-quelques-valeurs" class="level1">
<h1>Lecture et affichage de quelques valeurs</h1>
<p>Pour visualiser un nombre limité de valeurs, par exemple 5, deux approches sont possibles :</p>
<ul>
<li>Sélectionner un échantillon restreint sur les premières lignes du <code>Parquet</code>, par exemple les 5 premières lignes ;</li>
<li>Sélectionner un échantillon aléatoire.</li>
</ul>
<p>Pour les premières lignes, la commande à utiliser est <code>LIMIT</code>.</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-6-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-6-1" aria-controls="tabset-6-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-6-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-6-2" aria-controls="tabset-6-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-6-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-6-3" aria-controls="tabset-6-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-6-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-6-4" aria-controls="tabset-6-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-6-1" class="tab-pane active" aria-labelledby="tabset-6-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb31-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb31-2">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb31-3">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement LIMIT 5"</span>)</span>
<span id="cb31-4">)</span>
<span id="cb31-5"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-6-2" class="tab-pane" aria-labelledby="tabset-6-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb32-1">duckdb.sql(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement LIMIT 5"</span>)</span></code></pre></div></div>
</div>
<div id="tabset-6-3" class="tab-pane" aria-labelledby="tabset-6-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb33-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(</span>
<span id="cb33-2">  con,</span>
<span id="cb33-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement LIMIT 5"</span></span>
<span id="cb33-4">)</span></code></pre></div></div>
</div>
<div id="tabset-6-4" class="tab-pane" aria-labelledby="tabset-6-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb34-1">table_logement <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb35" data-startfrom="406" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 405;"><span id="cb35-406">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb35-407">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement LIMIT 5"</span>)</span>
<span id="cb35-408">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-12" data-nodetype="expression">

</div>
</div>
</div>
<p>Pour un échantillon aléatoire, la commande à utiliser est <code>USING SAMPLE</code>.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb36" data-startfrom="435" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 434;"><span id="cb36-435">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb36-436">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement USIN SAMPLE 5"</span>)</span>
<span id="cb36-437">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-13" data-nodetype="expression">

</div>
</div>
</div>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-7-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-7-1" aria-controls="tabset-7-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-7-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-7-2" aria-controls="tabset-7-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-7-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-7-3" aria-controls="tabset-7-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-7-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-7-4" aria-controls="tabset-7-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-7-1" class="tab-pane active" aria-labelledby="tabset-7-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb37-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb37-2">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb37-3">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement USING SAMPLE 5"</span>)</span>
<span id="cb37-4">)</span>
<span id="cb37-5"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-7-2" class="tab-pane" aria-labelledby="tabset-7-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb38-1">duckdb.sql(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement USING SAMPLE 5"</span>)</span></code></pre></div></div>
</div>
<div id="tabset-7-3" class="tab-pane" aria-labelledby="tabset-7-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb39" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb39-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(</span>
<span id="cb39-2">  con,</span>
<span id="cb39-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement USING SAMPLE 5"</span></span>
<span id="cb39-4">)</span></code></pre></div></div>
</div>
<div id="tabset-7-4" class="tab-pane" aria-labelledby="tabset-7-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb40-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tbl</span>(con, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sql</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement USING SAMPLE 5"</span>))</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb41" data-startfrom="470" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 469;"><span id="cb41-470">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb41-471">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement USING SAMPLE 5"</span>)</span>
<span id="cb41-472">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-14" data-nodetype="expression">

</div>
</div>
</div>
</section>
<section id="sélectionner-des-observations-ou-des-variables" class="level1">
<h1>Sélectionner des observations ou des variables</h1>
<section id="requêtes-sur-les-colonnes-select" class="level2">
<h2 class="anchored" data-anchor-id="requêtes-sur-les-colonnes-select">Requêtes sur les colonnes (<code>SELECT</code>)</h2>
<p>La liste des colonnes à extraire du fichier peut être renseignée avec la clause <code>SELECT</code>. Celles-ci peuvent être renommées en appliquant au passage la clause <code>AS</code>.</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-8-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-8-1" aria-controls="tabset-8-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-8-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-8-2" aria-controls="tabset-8-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-8-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-8-3" aria-controls="tabset-8-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-8-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-8-4" aria-controls="tabset-8-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-8-1" class="tab-pane active" aria-labelledby="tabset-8-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb42" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb42-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb42-2">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb42-3">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT IPONDI AS poids, AGED, VOIT FROM table_individu LIMIT 10"</span>)</span>
<span id="cb42-4">)</span>
<span id="cb42-5"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-8-2" class="tab-pane" aria-labelledby="tabset-8-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb43" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb43-1">duckdb.sql(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT IPONDI AS poids, AGED, VOIT FROM table_individu LIMIT 10"</span>)</span></code></pre></div></div>
</div>
<div id="tabset-8-3" class="tab-pane" aria-labelledby="tabset-8-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb44" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb44-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(</span>
<span id="cb44-2">  con,</span>
<span id="cb44-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT IPONDI AS poids, AGED, VOIT FROM table_individu LIMIT 10"</span></span>
<span id="cb44-4">)</span></code></pre></div></div>
</div>
<div id="tabset-8-4" class="tab-pane" aria-labelledby="tabset-8-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb45" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb45-1">table_individu <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb45-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">poids =</span> IPONDI, AGED, VOIT) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb45-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb46" data-startfrom="502" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 501;"><span id="cb46-502">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb46-503">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT IPONDI AS poids, AGED, VOIT FROM table_individu LIMIT 10"</span>)</span>
<span id="cb46-504">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-15" data-nodetype="expression">

</div>
</div>
</div>
<p><code>DuckDB</code> propose également des fonctionnalités pour extraire des colonnes à travers des <a href="https://fr.wikipedia.org/wiki/Expression_r%C3%A9guli%C3%A8re">expressions régulières</a>. De nombreux exemples peuvent être trouvés sur <a href="https://duckdb.org/2023/08/23/even-friendlier-sql.html">cette page</a>.</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-9-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-9-1" aria-controls="tabset-9-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-9-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-9-2" aria-controls="tabset-9-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-9-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-9-3" aria-controls="tabset-9-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-9-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-9-4" aria-controls="tabset-9-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-9-1" class="tab-pane active" aria-labelledby="tabset-9-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb47" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb47-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb47-2">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb47-3">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT IPONDI AS poids, COLUMNS('.*AGE.*') FROM table_individu LIMIT 10"</span>)</span>
<span id="cb47-4">)</span>
<span id="cb47-5"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-9-2" class="tab-pane" aria-labelledby="tabset-9-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb48" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb48-1">duckdb.sql(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT IPONDI AS poids, COLUMNS('.*AGE.*') FROM table_individu LIMIT 10"</span>)</span></code></pre></div></div>
</div>
<div id="tabset-9-3" class="tab-pane" aria-labelledby="tabset-9-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb49" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb49-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(</span>
<span id="cb49-2">  con,</span>
<span id="cb49-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT IPONDI AS poids, COLUMNS('.*AGE.*') FROM table_individu LIMIT 10"</span></span>
<span id="cb49-4">)</span></code></pre></div></div>
</div>
<div id="tabset-9-4" class="tab-pane" aria-labelledby="tabset-9-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb50" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb50-1">table_individu <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb50-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">poids =</span> IPONDI, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">contains</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"AGE"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb50-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb51" data-startfrom="540" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 539;"><span id="cb51-540">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb51-541">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT IPONDI AS poids, COLUMNS('.*AGE.*') FROM table_individu LIMIT 10"</span>)</span>
<span id="cb51-542">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-16" data-nodetype="expression">

</div>
</div>
</div>
</section>
<section id="requêtes-sur-les-lignes-where" class="level2">
<h2 class="anchored" data-anchor-id="requêtes-sur-les-lignes-where">Requêtes sur les lignes (<code>WHERE</code>)</h2>
<p>Pour extraire un sous-échantillon des données complètes, la clause <code>WHERE</code> permet d’appliquer des filtres à partir de conditions logiques. Par exemple, il est possible de ne conserver, du fichier national, que les données de l’Aude (11), de la Haute-Garonne (31) et de l’Hérault (34).</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-10-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-10-1" aria-controls="tabset-10-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-10-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-10-2" aria-controls="tabset-10-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-10-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-10-3" aria-controls="tabset-10-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-10-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-10-4" aria-controls="tabset-10-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-10-1" class="tab-pane active" aria-labelledby="tabset-10-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb52" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb52-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb52-2">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb52-3">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_individu WHERE DEPT IN ('11', '31', '34') LIMIT 10"</span>)</span>
<span id="cb52-4">)</span>
<span id="cb52-5"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-10-2" class="tab-pane" aria-labelledby="tabset-10-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb53" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb53-1">duckdb.sql(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_individu WHERE DEPT IN ('11', '31', '34')"</span>)</span></code></pre></div></div>
</div>
<div id="tabset-10-3" class="tab-pane" aria-labelledby="tabset-10-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb54" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb54-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(</span>
<span id="cb54-2">  con,</span>
<span id="cb54-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_individu WHERE DEPT IN ('11', '31', '34')"</span></span>
<span id="cb54-4">)</span></code></pre></div></div>
</div>
<div id="tabset-10-4" class="tab-pane" aria-labelledby="tabset-10-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb55" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb55-1">table_individu <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb55-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(DEPT <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"31"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"34"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb55-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb56" data-startfrom="573" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 572;"><span id="cb56-573">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb56-574">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_individu WHERE DEPT IN ('11', '31', '34') LIMIT 10"</span>)</span>
<span id="cb56-575">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-17" data-nodetype="expression">

</div>
</div>
</div>
<p>Il est également possible de formater cette liste telle qu’attendue par SQL à partir d’une liste <code>Python</code> ou d’un vecteur <code>R</code> plus classique. Pour cela, le code suivant peut servir de modèle :</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-11-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-11-1" aria-controls="tabset-11-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-11-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-11-2" aria-controls="tabset-11-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-11-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-11-3" aria-controls="tabset-11-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-11-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-11-4" aria-controls="tabset-11-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-11-1" class="tab-pane active" aria-labelledby="tabset-11-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb57" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb57-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb57-2">liste_regions <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"31"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"34"</span>]</span>
<span id="cb57-3">liste_regions_sql <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> liste_regions<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>(item <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>item<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">'`</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">join</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span>)</span>
<span id="cb57-4">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb57-5">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`SELECT * FROM table_individu WHERE DEPT IN (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>liste_regions_sql<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">) LIMIT 10`</span>)</span>
<span id="cb57-6">)</span>
<span id="cb57-7"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-11-2" class="tab-pane" aria-labelledby="tabset-11-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb58" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb58-1">con <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> duckdb.<span class="ex" style="color: null;
background-color: null;
font-style: inherit;">connect</span>()</span>
<span id="cb58-2"></span>
<span id="cb58-3">con.execute(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'''</span></span>
<span id="cb58-4"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  CREATE OR REPLACE VIEW table_individu</span></span>
<span id="cb58-5"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  AS SELECT * FROM read_parquet("FD_INDCVI_2020.parquet")</span></span>
<span id="cb58-6"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'''</span></span>
<span id="cb58-7">)</span>
<span id="cb58-8"></span>
<span id="cb58-9">liste_regions <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"31"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"34"</span>]</span>
<span id="cb58-10"></span>
<span id="cb58-11">dep_slots <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"?"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> liste_regions])</span>
<span id="cb58-12">query <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_individu WHERE DEPT IN (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(dep_slots)</span>
<span id="cb58-13">liste_regions_sql <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join([<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dep<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dep <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> liste_regions])</span>
<span id="cb58-14">con.execute(query, liste_regions).fetchdf()</span></code></pre></div></div>
</div>
<div id="tabset-11-3" class="tab-pane" aria-labelledby="tabset-11-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb59" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb59-1">liste_regions <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"31"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"34"</span>)</span>
<span id="cb59-2">liste_regions_sql <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql_collapse</span>(</span>
<span id="cb59-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lapply</span>(</span>
<span id="cb59-4">    liste_regions, <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(dep) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"'{`dep`}'"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.con=</span>con)</span>
<span id="cb59-5">    ),</span>
<span id="cb59-6">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span></span>
<span id="cb59-7">)</span>
<span id="cb59-8">query <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql</span>(</span>
<span id="cb59-9">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_individu WHERE DEPT IN ({liste_regions_sql})"</span>,</span>
<span id="cb59-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.con=</span>con</span>
<span id="cb59-11">)</span>
<span id="cb59-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(con, query)</span></code></pre></div></div>
</div>
<div id="tabset-11-4" class="tab-pane" aria-labelledby="tabset-11-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb60" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb60-1">liste_regions <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"31"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"34"</span>)</span>
<span id="cb60-2">table_individu <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb60-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(DEPT <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> liste_regions)</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb61" data-startfrom="615" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 614;"><span id="cb61-615">liste_regions <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"31"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"34"</span>]</span>
<span id="cb61-616">liste_regions_sql <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> liste_regions<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>(item <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>item<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">'`</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">join</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span>)</span>
<span id="cb61-617">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb61-618">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`SELECT * FROM table_individu WHERE DEPT IN (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>liste_regions_sql<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">) LIMIT 10`</span>)</span>
<span id="cb61-619">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-18-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-18-2" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-18-3" data-nodetype="expression">

</div>
</div>
</div>
</div>
<p>Pour en savoir plus sur les <em>prepared statements</em> avec DuckDB en Python, et plus généralement pour avoir des exemples d’utilisations différentes, c’est <a href="https://duckdb.org/docs/api/python/dbapi.html">ici</a> que ça se passe.</p>
<p><br></p>
<p>Les filtres sur les observations peuvent être faits à partir de critères sur plusieurs colonnes. Par exemple, pour ne conserver que les observations de la ville de Nice où la date d’emménagement est postérieure à 2020, la requête suivante peut être utilisée :</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-12-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-12-1" aria-controls="tabset-12-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-12-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-12-2" aria-controls="tabset-12-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-12-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-12-3" aria-controls="tabset-12-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-12-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-12-4" aria-controls="tabset-12-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-12-1" class="tab-pane active" aria-labelledby="tabset-12-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb62" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb62-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb62-2">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb62-3">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb62-4">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement WHERE COMMUNE = '06088' and AEMM &gt; 2020"</span></span>
<span id="cb62-5">    )</span>
<span id="cb62-6">)</span>
<span id="cb62-7"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-12-2" class="tab-pane" aria-labelledby="tabset-12-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb63" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb63-1">query <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement WHERE COMMUNE = '06088' and AEMM &gt; 2020"</span></span>
<span id="cb63-2">duckdb.sql(query)</span></code></pre></div></div>
</div>
<div id="tabset-12-3" class="tab-pane" aria-labelledby="tabset-12-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb64" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb64-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(</span>
<span id="cb64-2">  con,</span>
<span id="cb64-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement WHERE COMMUNE = '06088' and AEMM &gt; 2020"</span></span>
<span id="cb64-4">)</span></code></pre></div></div>
</div>
<div id="tabset-12-4" class="tab-pane" aria-labelledby="tabset-12-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb65" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb65-1">table_logement <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb65-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(COMMUNE <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"06088"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb65-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(AEMM <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2020</span>)</span>
<span id="cb65-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Peut aussi s'écrire en une fois :</span></span>
<span id="cb65-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># table_logement %&gt;% filter(COMMUNE == "06088", AEMM &gt; 2020)</span></span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb66" data-startfrom="669" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 668;"><span id="cb66-669">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb66-670">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb66-671">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM table_logement WHERE COMMUNE = '06088' and AEMM &gt; 2020"</span></span>
<span id="cb66-672">    )</span>
<span id="cb66-673">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-19" data-nodetype="expression">

</div>
</div>
</div>
</section>
</section>
<section id="statistiques-agrégées" class="level1">
<h1>Statistiques agrégées</h1>
<p>Le langage <code>SQL</code> permet d’exécuter de manière très efficace des requêtes complexes afin de construire, à partir de données fines, des statistiques agrégées.</p>
<p>Cette partie illustre d’abord ceci avec deux exemples de statistiques agrégées renvoyant une unique statistique :</p>
<ul>
<li>Extraire la liste des codes arrondissements de Paris, Lyon, Marseille où au moins une personne a été recensée ;</li>
<li>Reproduire l’exemple de <span class="citation" data-cites="mauviere-2022">Mauvière (2022)</span> permettant de calculer le nombre d’habitants de Toulouse qui ont changé de logement en un an ;</li>
</ul>
<p>Ensuite, des statistiques plus fines sont construites par le biais d’agrégations par groupe :</p>
<ul>
<li>Calculer le nombre de personnes recensées par cohorte pour les départements de l’Aude (11), de la Haute-Garonne (31) et de l’Hérault (34) ;</li>
<li>Calculer le nombre de centenaires recensés par département.</li>
</ul>
<p>La fonction <code>DISTINCT</code> appliquée à la variable <code>ARM</code> permet d’extraire la liste des codes arrondissements présents dans la base de données.</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-13-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-13-1" aria-controls="tabset-13-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-13-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-13-2" aria-controls="tabset-13-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-13-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-13-3" aria-controls="tabset-13-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-13-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-13-4" aria-controls="tabset-13-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-13-1" class="tab-pane active" aria-labelledby="tabset-13-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb67" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb67-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb67-2">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb67-3">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb67-4">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT DISTINCT(ARM) FROM table_logement WHERE NOT CONTAINS(ARM, 'ZZZZZ') ORDER BY ARM"</span></span>
<span id="cb67-5">    )</span>
<span id="cb67-6">)</span>
<span id="cb67-7"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-13-2" class="tab-pane" aria-labelledby="tabset-13-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb68" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb68-1">query <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT DISTINCT(ARM) "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+\</span></span>
<span id="cb68-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FROM table_logement "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+\</span></span>
<span id="cb68-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WHERE NOT CONTAINS(ARM, 'ZZZZZ') "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+\</span></span>
<span id="cb68-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ORDER BY ARM"</span></span>
<span id="cb68-5">duckdb.sql(query)</span></code></pre></div></div>
</div>
<div id="tabset-13-3" class="tab-pane" aria-labelledby="tabset-13-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb69" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb69-1">query <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql</span>(</span>
<span id="cb69-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT DISTINCT(ARM) "</span>,</span>
<span id="cb69-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FROM table_logement "</span>,</span>
<span id="cb69-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WHERE NOT CONTAINS(ARM, 'ZZZZZ') "</span>,</span>
<span id="cb69-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ORDER BY ARM"</span>,</span>
<span id="cb69-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.con=</span>con</span>
<span id="cb69-7">)</span>
<span id="cb69-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(con, query)</span></code></pre></div></div>
</div>
<div id="tabset-13-4" class="tab-pane" aria-labelledby="tabset-13-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb70" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb70-1">table_logement <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb70-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(ARM, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ZZZZZ"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">negate =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb70-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ARM =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>(ARM)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb70-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(ARM)</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb71" data-startfrom="703" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 702;"><span id="cb71-703">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb71-704">    db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb71-705">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT DISTINCT(ARM) FROM table_logement WHERE NOT CONTAINS(ARM, 'ZZZZZ') ORDER BY ARM"</span></span>
<span id="cb71-706">    )</span>
<span id="cb71-707">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-20" data-nodetype="expression">

</div>
</div>
</div>
<p>Il est possible d’extraire des statistiques beaucoup plus raffinées par le biais d’une requête SQL plus complexe. Par exemple pour calculer le nombre d’habitants de Toulouse qui ont changé de logement en un an:</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-14-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-14-1" aria-controls="tabset-14-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-14-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-14-2" aria-controls="tabset-14-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-14-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-14-3" aria-controls="tabset-14-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-14-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-14-4" aria-controls="tabset-14-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-14-1" class="tab-pane active" aria-labelledby="tabset-14-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb72" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb72-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb72-2">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb72-3">  db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb72-4">    <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb72-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    SELECT CAST(</span></span>
<span id="cb72-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">      SUM(IPONDL*CAST(INPER AS INT)) AS INT</span></span>
<span id="cb72-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    ) AS habitants_toulouse_demenagement</span></span>
<span id="cb72-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    FROM table_logement</span></span>
<span id="cb72-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    WHERE COMMUNE == '31555' AND IRANM NOT IN ('1', 'Z') AND INPER != 'Y'</span></span>
<span id="cb72-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    `</span></span>
<span id="cb72-11">  )</span>
<span id="cb72-12">)</span>
<span id="cb72-13"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-14-2" class="tab-pane" aria-labelledby="tabset-14-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb73" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb73-1">query <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb73-2"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span></span>
<span id="cb73-3"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">SELECT CAST(</span></span>
<span id="cb73-4"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  SUM(IPONDL*CAST(INPER AS INT)) AS INT</span></span>
<span id="cb73-5"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">) AS habitants_toulouse_demenagement</span></span>
<span id="cb73-6"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">FROM table_logement</span></span>
<span id="cb73-7"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">WHERE COMMUNE == '31555' AND IRANM NOT IN ('1', 'Z') AND INPER != 'Y'</span></span>
<span id="cb73-8"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span></span>
<span id="cb73-9">duckdb.sql(query).df()</span></code></pre></div></div>
</div>
<div id="tabset-14-3" class="tab-pane" aria-labelledby="tabset-14-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb74" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb74-1">query <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(</span>
<span id="cb74-2">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT CAST(SUM(IPONDL*CAST(INPER AS INT)) AS INT) "</span>,</span>
<span id="cb74-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"AS habitants_toulouse_demenagement"</span>,</span>
<span id="cb74-4">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FROM table_logement"</span>,</span>
<span id="cb74-5">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WHERE COMMUNE == '31555' AND IRANM NOT IN ('1', 'Z') AND INPER != 'Y'"</span>,</span>
<span id="cb74-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>)</span>
<span id="cb74-7"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(con, query)</span></code></pre></div></div>
</div>
<div id="tabset-14-4" class="tab-pane" aria-labelledby="tabset-14-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb75" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb75-1">table_logement <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb75-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(COMMUNE <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'31555'</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span>IRANM <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'1'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Z'</span>), INPER <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Y"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb75-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">INPER =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(INPER)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb75-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">habitants_toulouse_demenagement =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(IPONDL <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> INPER)))</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb76" data-startfrom="758" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 757;"><span id="cb76-758">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb76-759">  db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb76-760">    <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb76-761"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    SELECT CAST(</span></span>
<span id="cb76-762"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">      SUM(IPONDL*CAST(INPER AS INT)) AS INT</span></span>
<span id="cb76-763"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    ) AS habitants_toulouse_demenagement</span></span>
<span id="cb76-764"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    FROM table_logement</span></span>
<span id="cb76-765"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    WHERE COMMUNE == '31555' AND IRANM NOT IN ('1', 'Z') AND INPER != 'Y'</span></span>
<span id="cb76-766"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    `</span></span>
<span id="cb76-767">  )</span>
<span id="cb76-768">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-21" data-nodetype="expression">

</div>
</div>
</div>
<p>Pour représenter la pyramide des âges recensés dans ces trois départements, il est possible de procéder en deux étapes</p>
<ul>
<li>Effectuer une agrégation par le biais de <code>DuckDB</code> et transformer ces résultats sous forme de <em>dataframe</em></li>
<li>Utiliser ce <em>dataframe</em> avec un <em>package</em> d’analyse graphique pour représenter la pyramide des âges.</li>
</ul>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>Pour illustrer le parallélisme possible entre les codes <code>R</code> et <code>Python</code>, l’exemple de représentation graphique ci-dessus s’appuie sur le <em>package</em> <code>plotnine</code> - dont la syntaxe reproduit celle du <em>package</em> <code>R</code> <code>ggplot2</code>, plutôt que sur <code>matplotlib</code> ou <code>seaborn</code>.</p>
</div>
</div>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-15-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-15-1" aria-controls="tabset-15-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-15-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-15-2" aria-controls="tabset-15-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-15-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-15-3" aria-controls="tabset-15-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-15-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-15-4" aria-controls="tabset-15-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-15-1" class="tab-pane active" aria-labelledby="tabset-15-1-tab">
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-4-contents" aria-controls="callout-4" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Mise en garde</span>Version de <code>Plot</code> embarquée dans <code>Quarto</code>
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-4" class="callout-4-contents callout-collapse collapse">
<div class="callout-body-container callout-body">
<p>Pour les versions de <code>Quarto</code> antérieures à la v1.4, la version embarquée par défaut de la librairie <code>Plot</code> ne propose pas d’interactivité par le biais des <a href="https://observablehq.com/plot/marks/tip"><em>tooltips</em></a>.</p>
<p>Pour utiliser une version compatible, par exemple la <code>0.6.11</code>, faire:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb77" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb77-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb77-2">Plot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">require</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://cdn.jsdelivr.net/npm/@observablehq/plot@0.6.11/dist/plot.umd.min.js"</span>)</span>
<span id="cb77-3"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
</div>
</div>
<details>
<summary>
Code pour structurer les données pour la représentation graphique.
</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb78" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb78-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb78-2">pyramide_ages <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb78-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb78-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">SELECT</span></span>
<span id="cb78-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  CAST(SUM(IPONDI) AS INT) AS individus,</span></span>
<span id="cb78-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  CAST(AGED AS INT) AS AGED,</span></span>
<span id="cb78-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  DEPT AS departement</span></span>
<span id="cb78-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">FROM table_individu</span></span>
<span id="cb78-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  WHERE DEPT IN ('11', '31', '34')</span></span>
<span id="cb78-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">GROUP BY AGED, DEPT ORDER BY DEPT, AGED</span></span>
<span id="cb78-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb78-12">)</span>
<span id="cb78-13">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(pyramide_ages)</span>
<span id="cb78-14"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</details>
<details>
<summary>
Code pour produire la représentation graphique.
</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb79" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb79-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb79-2">Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>({</span>
<span id="cb79-3">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">null</span>}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb79-4">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">percent</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">true</span>}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb79-5">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marks</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="cb79-6">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">barY</span>(</span>
<span id="cb79-7">        pyramide_ages<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb79-8">        {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"AGED"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">individus</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fy</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'departement'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fill</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"departement"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">tip</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">true</span>}</span>
<span id="cb79-9">        )<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb79-10">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ruleX</span>([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">stroke</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>})<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb79-11">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tickY</span>(</span>
<span id="cb79-12">        pyramide_ages<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb79-13">        {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"AGED"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">individus</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fy</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'departement'</span>}</span>
<span id="cb79-14">        )<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb79-15">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ruleY</span>([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb79-16">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">axisY</span>({<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Population (en milliers)"</span>})<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb79-17">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">axisX</span>({<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">ticks</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> d3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ticks</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">120</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Âge"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fontSize</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>})</span>
<span id="cb79-18">  ]</span>
<span id="cb79-19">})</span>
<span id="cb79-20"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</details>
</div>
<div id="tabset-15-2" class="tab-pane" aria-labelledby="tabset-15-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb80" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb80-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb80-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> plotnine <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span></span>
<span id="cb80-3"></span>
<span id="cb80-4">pyramide_ages <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> duckdb.sql(</span>
<span id="cb80-5"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span></span>
<span id="cb80-6"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">SELECT</span></span>
<span id="cb80-7"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  SUM(IPONDI) AS individus,</span></span>
<span id="cb80-8"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  CAST(AGED AS int) AS AGED,</span></span>
<span id="cb80-9"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  DEPT AS departement</span></span>
<span id="cb80-10"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">FROM table_individu</span></span>
<span id="cb80-11"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  WHERE DEPT IN ('11', '31', '34')</span></span>
<span id="cb80-12"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">GROUP BY AGED, DEPT ORDER BY DEPT, AGED</span></span>
<span id="cb80-13"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span></span>
<span id="cb80-14">).to_df()</span>
<span id="cb80-15"></span>
<span id="cb80-16">(</span>
<span id="cb80-17">    ggplot(pyramide_ages, aes(x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"AGED"</span>, y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"individus"</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb80-18">    geom_bar(</span>
<span id="cb80-19">      aes(fill <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"departement"</span>),</span>
<span id="cb80-20">      stat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, show_legend<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span></span>
<span id="cb80-21">    ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb80-22">    geom_vline(xintercept <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, color <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey"</span>, linetype <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb80-23">    facet_wrap(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'departement'</span>, scales <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free_y"</span>, nrow <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb80-24">    theme_minimal() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb80-25">    labs(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Individus recensés"</span>, x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Âge"</span>)</span>
<span id="cb80-26">)</span></code></pre></div></div>
</div>
<div id="tabset-15-3" class="tab-pane" aria-labelledby="tabset-15-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb81" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb81-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(labeling)</span>
<span id="cb81-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb81-3"></span>
<span id="cb81-4">query <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(</span>
<span id="cb81-5">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT SUM(IPONDI) AS individus, AGED, DEPT AS departement"</span>,</span>
<span id="cb81-6">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FROM table_individu"</span>,</span>
<span id="cb81-7">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WHERE DEPT IN ('11', '31', '34')"</span>,</span>
<span id="cb81-8">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GROUP BY AGED, DEPT"</span>,</span>
<span id="cb81-9">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ORDER BY DEPT, AGED"</span>,</span>
<span id="cb81-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span></span>
<span id="cb81-11">)</span>
<span id="cb81-12">pyramide_ages <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(con, query)</span>
<span id="cb81-13"></span>
<span id="cb81-14"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(pyramide_ages, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> AGED, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> individus)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb81-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_bar</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> departement), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stat =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb81-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb81-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>departement, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scales =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free_y"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb81-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_minimal</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb81-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Individus recensés"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Âge"</span>)</span></code></pre></div></div>
</div>
<div id="tabset-15-4" class="tab-pane" aria-labelledby="tabset-15-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb82" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb82-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(labeling)</span>
<span id="cb82-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb82-3"></span>
<span id="cb82-4">pyramide_ages <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> table_individu <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb82-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(DEPT <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'11'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'31'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'34'</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb82-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(AGED, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">departement =</span> DEPT) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb82-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">individus =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(IPONDI), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb82-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(departement, AGED) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb82-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">collect</span>()</span>
<span id="cb82-10"></span>
<span id="cb82-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(pyramide_ages, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> AGED, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> individus)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb82-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_bar</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> departement), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stat =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb82-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">color =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb82-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>departement, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scales =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free_y"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb82-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_minimal</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb82-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Individus recensés"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Âge"</span>)</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb83" data-startfrom="776" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 775;"><span id="cb83-776">pyramide_ages <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb83-777"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb83-778"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">SELECT</span></span>
<span id="cb83-779"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  CAST(SUM(IPONDI) AS INT) AS individus,</span></span>
<span id="cb83-780"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  CAST(AGED AS INT) AS AGED,</span></span>
<span id="cb83-781"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  DEPT AS departement</span></span>
<span id="cb83-782"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">FROM table_individu</span></span>
<span id="cb83-783"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  WHERE DEPT IN ('11', '31', '34')</span></span>
<span id="cb83-784"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">GROUP BY AGED, DEPT ORDER BY DEPT, AGED</span></span>
<span id="cb83-785"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb83-786">)</span>
<span id="cb83-787">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(pyramide_ages)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-22-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-22-2" data-nodetype="expression">

</div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb84" data-startfrom="825" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 824;"><span id="cb84-825">Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>({</span>
<span id="cb84-826">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">null</span>}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb84-827">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">percent</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">true</span>}<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb84-828">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">marks</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> [</span>
<span id="cb84-829">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">barY</span>(</span>
<span id="cb84-830">        pyramide_ages<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb84-831">        {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"AGED"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">individus</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fy</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'departement'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fill</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"departement"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">tip</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">true</span>}</span>
<span id="cb84-832">        )<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb84-833">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ruleX</span>([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">stroke</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>})<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb84-834">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tickY</span>(</span>
<span id="cb84-835">        pyramide_ages<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb84-836">        {<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"AGED"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">individus</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fy</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'departement'</span>}</span>
<span id="cb84-837">        )<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb84-838">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ruleY</span>([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb84-839">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">axisY</span>({<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Population (en milliers)"</span>})<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb84-840">    Plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">axisX</span>({<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">ticks</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> d3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ticks</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">120</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">label</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Âge"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">fontSize</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>})</span>
<span id="cb84-841">  ]</span>
<span id="cb84-842">})</span></code></pre></div></div>
<div id="fig-ojs-cell-23" class="cell-output cell-output-display quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-ojs-cell-23-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div id="ojs-cell-23" data-nodetype="expression">

</div>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-ojs-cell-23-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Un exemple de représentation graphique produite à partir du recensement de la population
</figcaption>
</figure>
</div>
</div>
<p>Si on s’intéresse plus spécifiquement au nombre de centenaires recensés par département et qu’on désire classer ces derniers par ordre décroissant.</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-16-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-16-1" aria-controls="tabset-16-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-16-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-16-2" aria-controls="tabset-16-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-16-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-16-3" aria-controls="tabset-16-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-16-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-16-4" aria-controls="tabset-16-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-16-1" class="tab-pane active" aria-labelledby="tabset-16-1-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb85" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb85-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb85-2">db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb85-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb85-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">SELECT</span></span>
<span id="cb85-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  SUM(IPONDI) AS individus_recenses,</span></span>
<span id="cb85-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  DEPT</span></span>
<span id="cb85-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">FROM table_individu</span></span>
<span id="cb85-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  WHERE AGED &gt;= 100</span></span>
<span id="cb85-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">GROUP BY DEPT</span></span>
<span id="cb85-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ORDER BY individus_recenses DESC</span></span>
<span id="cb85-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb85-12">)</span>
<span id="cb85-13"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-16-2" class="tab-pane" aria-labelledby="tabset-16-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb86" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb86-1">duckdb.sql(</span>
<span id="cb86-2"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span></span>
<span id="cb86-3"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">SELECT</span></span>
<span id="cb86-4"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  SUM(IPONDI) AS individus_recenses,</span></span>
<span id="cb86-5"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  DEPT</span></span>
<span id="cb86-6"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">FROM table_individu</span></span>
<span id="cb86-7"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  WHERE AGED &gt;= 100</span></span>
<span id="cb86-8"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">GROUP BY DEPT</span></span>
<span id="cb86-9"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">ORDER BY individus_recenses DESC</span></span>
<span id="cb86-10"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span></span>
<span id="cb86-11">)</span></code></pre></div></div>
</div>
<div id="tabset-16-3" class="tab-pane" aria-labelledby="tabset-16-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb87" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb87-1">query <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(</span>
<span id="cb87-2">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT SUM(IPONDI) AS individus_recenses, DEPT"</span>,</span>
<span id="cb87-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FROM table_individu"</span>,</span>
<span id="cb87-4">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WHERE AGED &gt;= 100"</span>,</span>
<span id="cb87-5">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GROUP BY DEPT"</span>,</span>
<span id="cb87-6">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ORDER BY individus_recenses DESC"</span>,</span>
<span id="cb87-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span></span>
<span id="cb87-8">)</span>
<span id="cb87-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(con, query)</span></code></pre></div></div>
</div>
<div id="tabset-16-4" class="tab-pane" aria-labelledby="tabset-16-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb88" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb88-1">table_individu <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb88-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(AGED <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb88-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(DEPT) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb88-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">individus_recenses =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(IPONDI)), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb88-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(individus_recenses))</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb89" data-startfrom="923" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 922;"><span id="cb89-923">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb89-924">  db<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb89-925">  <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb89-926"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  SELECT</span></span>
<span id="cb89-927"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CAST(SUM(IPONDI) AS INT) AS individus_recenses,</span></span>
<span id="cb89-928"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    DEPT</span></span>
<span id="cb89-929"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  FROM table_individu</span></span>
<span id="cb89-930"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    WHERE AGED &gt;= 100</span></span>
<span id="cb89-931"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  GROUP BY DEPT</span></span>
<span id="cb89-932"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  ORDER BY individus_recenses DESC</span></span>
<span id="cb89-933"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  `</span></span>
<span id="cb89-934">  )</span>
<span id="cb89-935">)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div id="ojs-cell-24" data-nodetype="expression">

</div>
</div>
</div>
</section>
<section id="associer-à-dautres-sources-de-données" class="level1">
<h1>Associer à d’autres sources de données</h1>
<p>Le <a href="https://www.insee.fr/fr/information/6800675"><em>code officiel géographique</em> (COG)</a> est utile pour illuster l’ajout d’information annexe. Le code commune va être utilisé pour associer les deux bases de données. Cette variable porte des noms différents dans les deux bases, ce qui n’est pas un problème.</p>
<p>Il est proposé, ci-dessous, de télécharger les données de manière reproductible, via une fonction adaptée (ici à travers le <em>package</em> <code>requests</code> pour <code>Python</code> ou via <code>download.file</code> en <code>R</code>). Bien que <code>DuckDB</code> permette l’import direct depuis un <em>url</em>, ceci implique l’installation en amont de l’<a href="https://duckdb.org/docs/extensions/httpfs.html">extension <code>httpfs</code></a>.</p>
<p>L’association de sources de données passe généralement par un <code>JOIN</code>. Pour illustrer cette clause, il est possible d’associer les agrégats de la table logement à un niveau communal avec celles du COG grâce au code commune.</p>
<div class="tabset-margin-container"></div><div class="panel-tabset" data-group="language">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" id="tabset-17-1-tab" data-bs-toggle="tab" data-bs-target="#tabset-17-1" aria-controls="tabset-17-1" aria-selected="true" href=""><code>Observable</code> via <code>Quarto</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-17-2-tab" data-bs-toggle="tab" data-bs-target="#tabset-17-2" aria-controls="tabset-17-2" aria-selected="false" href=""><code>Python</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-17-3-tab" data-bs-toggle="tab" data-bs-target="#tabset-17-3" aria-controls="tabset-17-3" aria-selected="false" href=""><code>R</code></a></li><li class="nav-item"><a class="nav-link" id="tabset-17-4-tab" data-bs-toggle="tab" data-bs-target="#tabset-17-4" aria-controls="tabset-17-4" aria-selected="false" href=""><code>R (dbplyr)</code></a></li></ul>
<div class="tab-content" data-group="language">
<div id="tabset-17-1" class="tab-pane active" aria-labelledby="tabset-17-1-tab">
<p>La lecture directe depuis <code>Observable</code> du fichier par le biais du protocole <code>https</code> vers le site de l’Insee ne fonctionnant pas, il est recommandé de télécharger en amont le fichier par l’intermédiaire de <code>Python</code> ou de <code>R</code>.</p>
<details>
<summary>
Code <code>Python</code> pour récupérer le code officiel géographique
</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb90" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb90-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> requests</span>
<span id="cb90-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os</span>
<span id="cb90-3"></span>
<span id="cb90-4">url_cog <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://www.insee.fr/fr/statistiques/fichier/6800675/v_commune_2023.csv"</span></span>
<span id="cb90-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> os.path.exists(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cog.csv"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>:</span>
<span id="cb90-6">  response <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> requests.get(url_cog)</span>
<span id="cb90-7">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">open</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cog.csv"</span>, mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wb"</span>) <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">file</span>:</span>
<span id="cb90-8">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">file</span>.write(response.content)</span></code></pre></div></div>
</details>
<details>
<summary>
Code <code>R</code> pour récupérer le code officiel géographique
</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb91" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb91-1">url <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://www.insee.fr/fr/statistiques/fichier/6800675/v_commune_2023.csv"</span></span>
<span id="cb91-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download.file</span>(url, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cog.csv"</span>)</span></code></pre></div></div>
</details>
<p>Après avoir récupérées les données, ce code peut permettre de créer une base de données intégrant le code officiel géographique:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb92" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb92-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb92-2">db2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb92-3">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> configuredClient <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> db <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb92-4">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb92-5">    <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb92-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE OR REPLACE VIEW cog2023 AS</span></span>
<span id="cb92-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    SELECT * FROM read_csv_auto('cog.csv', header = true)</span></span>
<span id="cb92-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    `</span></span>
<span id="cb92-9">    )</span>
<span id="cb92-10"></span>
<span id="cb92-11">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> configuredClient <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb92-12"></span>
<span id="cb92-13">}</span>
<span id="cb92-14"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb93" style="background: #f1f3f5;"><pre class="sourceCode markdown code-with-copy"><code class="sourceCode markdown"><span id="cb93-1"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```{ojs}</span></span>
<span id="cb93-2">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb93-3">  db2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb93-4">    <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb93-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    SELECT cog2023.NCCENR, CAST(SUM(table_logement.IPONDL) AS INT) AS recenses</span></span>
<span id="cb93-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    FROM table_logement</span></span>
<span id="cb93-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    LEFT OUTER JOIN cog2023 ON table_logement.COMMUNE = cog2023.COM</span></span>
<span id="cb93-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    GROUP BY cog2023.NCCENR</span></span>
<span id="cb93-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    ORDER BY recenses;</span></span>
<span id="cb93-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    `</span></span>
<span id="cb93-11">  )  </span>
<span id="cb93-12">)</span>
<span id="cb93-13"><span class="in" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">```</span></span></code></pre></div></div>
</div>
<div id="tabset-17-2" class="tab-pane" aria-labelledby="tabset-17-2-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb94" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb94-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> requests</span>
<span id="cb94-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os</span>
<span id="cb94-3"></span>
<span id="cb94-4">url_cog <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://www.insee.fr/fr/statistiques/fichier/6800675/v_commune_2023.csv"</span></span>
<span id="cb94-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> os.path.exists(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cog.csv"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>:</span>
<span id="cb94-6">  response <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> requests.get(url_cog)</span>
<span id="cb94-7">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">open</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cog.csv"</span>, mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wb"</span>) <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">file</span>:</span>
<span id="cb94-8">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">file</span>.write(response.content)</span></code></pre></div></div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb95" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb95-1">duckdb.sql(</span>
<span id="cb95-2">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CREATE OR REPLACE VIEW cog2023 AS '</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+\</span></span>
<span id="cb95-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'SELECT * FROM read_csv_auto("cog.csv", header=true)'</span></span>
<span id="cb95-4">)</span></code></pre></div></div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb96" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb96-1">duckdb.sql(</span>
<span id="cb96-2"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span></span>
<span id="cb96-3"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">SELECT cog2023.NCCENR, CAST(SUM(table_logement.IPONDL) AS INT) AS recenses</span></span>
<span id="cb96-4"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">FROM table_logement</span></span>
<span id="cb96-5"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">LEFT OUTER JOIN cog2023 ON table_logement.COMMUNE = cog2023.COM</span></span>
<span id="cb96-6"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">GROUP BY cog2023.NCCENR</span></span>
<span id="cb96-7"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">ORDER BY recenses;</span></span>
<span id="cb96-8"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span></span>
<span id="cb96-9">)</span></code></pre></div></div>
</div>
<div id="tabset-17-3" class="tab-pane" aria-labelledby="tabset-17-3-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb97" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb97-1">url <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://www.insee.fr/fr/statistiques/fichier/6800675/v_commune_2023.csv"</span></span>
<span id="cb97-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download.file</span>(url, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cog.csv"</span>)</span>
<span id="cb97-3"></span>
<span id="cb97-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbExecute</span>(</span>
<span id="cb97-5">  con,</span>
<span id="cb97-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue_sql</span>(</span>
<span id="cb97-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CREATE OR REPLACE VIEW cog2023 AS "</span>,</span>
<span id="cb97-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT * FROM read_csv_auto("</span>cog.csv<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", header=true)"</span>,</span>
<span id="cb97-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.con=</span>con</span>
<span id="cb97-10">  )</span>
<span id="cb97-11">)</span>
<span id="cb97-12"></span>
<span id="cb97-13">query <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(</span>
<span id="cb97-14">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECT cog2023.NCCENR, CAST(SUM(table_logement.IPONDL) AS INT) AS recenses"</span>,</span>
<span id="cb97-15">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FROM table_logement"</span>,</span>
<span id="cb97-16">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LEFT OUTER JOIN cog2023 ON table_logement.COMMUNE = cog2023.COM"</span>,</span>
<span id="cb97-17">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GROUP BY cog2023.NCCENR ORDER BY recenses"</span>,</span>
<span id="cb97-18">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span></span>
<span id="cb97-19">)</span>
<span id="cb97-20"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dbGetQuery</span>(con, query)</span></code></pre></div></div>
</div>
<div id="tabset-17-4" class="tab-pane" aria-labelledby="tabset-17-4-tab">
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb98" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb98-1">url <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://www.insee.fr/fr/statistiques/fichier/6800675/v_commune_2023.csv"</span></span>
<span id="cb98-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download.file</span>(url, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cog.csv"</span>)</span></code></pre></div></div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb99" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb99-1">cog <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tbl</span>(con, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">glue</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'read_csv_auto("{path_data}/cog.csv", header = true)'</span>))</span></code></pre></div></div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb100" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb100-1">table_logement <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb100-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(cog, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"COMMUNE"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"COM"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb100-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(NCCENR) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb100-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">recenses =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(IPONDL)), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb100-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(recenses)</span></code></pre></div></div>
</div>
</div>
</div>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code hidden" id="cb101" data-startfrom="944" data-source-offset="-0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 943;"><span id="cb101-944">proxy <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://corsproxy.io/?"</span></span>
<span id="cb101-945">url_cog <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://www.insee.fr/fr/statistiques/fichier/6800675/v_commune_2023.csv"</span></span>
<span id="cb101-946">db2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb101-947">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> configuredClient <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> db <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb101-948">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">await</span> configuredClient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb101-949">    <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb101-950"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    CREATE OR REPLACE VIEW cog2023 AS</span></span>
<span id="cb101-951"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    SELECT * FROM read_csv_auto('</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">${</span>proxy <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> url_cog<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">', header = true)</span></span>
<span id="cb101-952"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    `</span></span>
<span id="cb101-953">    )</span>
<span id="cb101-954"></span>
<span id="cb101-955">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> configuredClient <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb101-956"></span>
<span id="cb101-957">}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-25-1" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-25-2" data-nodetype="declaration">

</div>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<div id="ojs-cell-25-3" data-nodetype="declaration">

</div>
</div>
</div>
</div>
<p>Les données du code officiel géographique présentent l’aspect suivant :</p>
<div class="cell">
<details class="code-fold">
<summary>Requête Observable pour explorer les premières lignes</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb102" data-startfrom="956" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript" style="counter-reset: source-line 955;"><span id="cb102-956">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb102-957">  db2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`SELECT * FROM cog2023 LIMIT 10`</span>)</span>
<span id="cb102-958">)</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">
<div id="ojs-cell-26" data-nodetype="expression">

</div>
</div>
</div>
<p>Voici par exemple le résultat d’une fusion avec une agrégation produite à la volée sur la table logement :</p>
<div class="cell">
<details class="code-fold">
<summary>Requête pour explorer les premières lignes</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb103" data-startfrom="1" data-source-offset="0" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb103-1">Inputs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(</span>
<span id="cb103-2">  db2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">query</span>(</span>
<span id="cb103-3">    <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb103-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    SELECT cog2023.NCCENR, CAST(SUM(table_logement.IPONDL) AS INT) AS recenses</span></span>
<span id="cb103-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    FROM table_logement</span></span>
<span id="cb103-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    LEFT OUTER JOIN cog2023 ON table_logement.COMMUNE = cog2023.COM</span></span>
<span id="cb103-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    GROUP BY cog2023.NCCENR</span></span>
<span id="cb103-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    ORDER BY recenses;</span></span>
<span id="cb103-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">    `</span></span>
<span id="cb103-10">  )  </span>
<span id="cb103-11">)</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">
<div id="ojs-cell-27" data-nodetype="expression">

</div>
</div>
</div>
<section id="références" class="level2">




</section>
</section>


<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">Références</h2><div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-dondon-lamarche-2023" class="csl-entry">
Dondon, Alexis, et Pierre Lamarche. 2023. <span>«&nbsp;Quels formats pour quelles données?&nbsp;»</span> <em>Courrier des statistiques</em>, nᵒ 9.
</div>
<div id="ref-mauviere-2022" class="csl-entry">
Mauvière, Éric. 2022. <span>«&nbsp;Parquet devrait remplacer le format CSV&nbsp;»</span>. Post de blog [Consulté le 12 octobre 2023]. <a href="https://www.icem7.fr/cartographie/parquet-devrait-remplacer-le-format-csv/">https://www.icem7.fr/cartographie/parquet-devrait-remplacer-le-format-csv/</a>.
</div>
</div></section><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Notes de bas de page</h2>

<ol>
<li id="fn1"><p>Des propositions d’enrichissements de cette documentation à partir d’implémentations alternatives, par exemple s’appuyant sur <code>Arrow</code> et <code>dbplyr</code> ou sur <code>Polars</code> sont bienvenues sur le <a href="https://github.com/InseeFrLab/exemples-recensement-parquet">Github InseeFrLab/exemples-recensement-parquet</a>.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>Python</category>
  <category>R</category>
  <category>Parquet</category>
  <guid>https://ssphub.netlify.app/post/parquetRP/</guid>
  <pubDate>Mon, 23 Oct 2023 00:00:00 GMT</pubDate>
  <media:content url="https://ssphub.netlify.app/post/parquetRP/ducks.png" medium="image" type="image/png" height="144" width="144"/>
</item>
</channel>
</rss>
