From acbdba6c5944c1bf7ae8da81a53a835027831d51 Mon Sep 17 00:00:00 2001 From: 981cdc59676c18d8d482e943cc649879 <981cdc59676c18d8d482e943cc649879@app-learninglab.inria.fr> Date: Mon, 18 Oct 2021 12:39:26 +0000 Subject: [PATCH] Ajout de commandes de bases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ces commandes ont été utilisées dans le cadre des exercices introductif à Jupyter --- journal/Readme.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/journal/Readme.md b/journal/Readme.md index f56eb60..1090bb8 100644 --- a/journal/Readme.md +++ b/journal/Readme.md @@ -1,9 +1,27 @@ # Journal de bord du Mooc / Mooc's logbook -FR +## Utilisation de Pyhton dans Jupyter -Espace réservé au journal de bord du Mooc +Petit tour de commandes pour utiliser python. La plupart est utilisable hors de jupyter. -EN +### Numpy -Reserved for the Mooc's logbook \ No newline at end of file ++ `import numpy as np` ++ `array = np.array(data_list)` ++ `np.amin(array) np.amax(array) ...` ++ `np.std(array, ddof=1)` pour une estimation "corrigée" de l'écart type empirique + +### Matplotlib + ++ `%matplotlib inline` pour que le plot soit afficher après l'exécution de la cellule ++ `import matplotlib.pyplot as plt` ++ Pyplot s'utilise comme un plot à état ou les différents appelles modifie le dernier plot ++ `plt.plot(data)` pour un linechart ++ `plt.hist(data)` pour un histogramme ++ `plt.plot(data, style...)` après les données d'un plot, on peut modifier l'apparance du plot des données + + `plt.plot(data, color='blue')` + + `plt.hist(data, color='blue', ec='black')` pour faire un histogramme avec les 'bins' délimités noir ++ `plt.axis([xmin, xmax, ymin, ymax])` ++ `plt.xlim([xmin, xmax])` idem avec y ++ `plt.grid(True, linestyle=':')` pour afficher le quadrillage en pointillés ++ `plt.show()` affiche le plot. Sans, il est afficher quand même grace à l'inline, mais il y a un output en plus \ No newline at end of file -- 2.18.1