mirror of
https://app-learninglab.inria.fr/moocrr/gitlab/da84ababf0696af51bddad556af86353/mooc-rr.git
synced 2026-06-17 09:35:24 +02:00
Début de l'analyse du journal pour le Module 2 exo 4
This commit is contained in:
parent
f4b6cc80f1
commit
912e8519b4
2 changed files with 65 additions and 0 deletions
55
module2/exo4/analyse-journal.org
Normal file
55
module2/exo4/analyse-journal.org
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#+TITLE: Analyse du journal
|
||||
#+AUTHOR: Louis Lacoste
|
||||
#+DATE: 2022-11-20
|
||||
#+LANGUAGE: fr
|
||||
# #+PROPERTY: header-args :eval never-export
|
||||
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/htmlize.css"/>
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css"/>
|
||||
#+HTML_HEAD: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
#+HTML_HEAD: <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
||||
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.js"></script>
|
||||
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script>
|
||||
|
||||
* Récupération des données du journal
|
||||
|
||||
Ici nous allons importer les étiquettes et les exporter dans un
|
||||
fichier =data.csv=.
|
||||
|
||||
#+begin_src shell :results output :exports both
|
||||
grep -oP "(?<=:)([a-zA-Z]*)(?=:)" ~/org/journal.org > data.csv
|
||||
head -n 5 data.csv
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: informatique
|
||||
: wikipedia
|
||||
: biologie
|
||||
: virus
|
||||
: allergie
|
||||
|
||||
* Traitement des données
|
||||
|
||||
#+NAME: import-python
|
||||
#+begin_src python :results output :session :exports both :dir /home/polarolouis/Documents/MOOC/RR/mooc-rr/module2/exo4
|
||||
import csv
|
||||
with open('data.csv', 'r', encoding='utf8') as csvfile:
|
||||
reader = csv.reader(csvfile)
|
||||
for row in reader:
|
||||
print(row)
|
||||
#+end_src
|
||||
|
||||
#+RESULTS: import-python
|
||||
#+begin_example
|
||||
|
||||
['informatique']
|
||||
['wikipedia']
|
||||
['biologie']
|
||||
['virus']
|
||||
['allergie']
|
||||
['biologie']
|
||||
['LOGBOOK']
|
||||
['END']
|
||||
['LOGBOOK']
|
||||
['END']
|
||||
#+end_example
|
||||
10
module2/exo4/data.csv
Normal file
10
module2/exo4/data.csv
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
informatique
|
||||
wikipedia
|
||||
biologie
|
||||
virus
|
||||
allergie
|
||||
biologie
|
||||
LOGBOOK
|
||||
END
|
||||
LOGBOOK
|
||||
END
|
||||
|
Loading…
Add table
Reference in a new issue