mirror of
https://app-learninglab.inria.fr/moocrr/gitlab/da84ababf0696af51bddad556af86353/mooc-rr.git
synced 2026-06-21 11:35:27 +02:00
55 lines
1.6 KiB
Org Mode
55 lines
1.6 KiB
Org Mode
#+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
|