Commit f4b6cc80 authored by Louis Lacoste's avatar Louis Lacoste

Module 2 exo 2

parent dc8c1bfb
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#+LANGUAGE: fr #+LANGUAGE: fr
# #+PROPERTY: header-args :eval never-export # #+PROPERTY: header-args :eval never-export
#+PROPERTY: mkdirp yes
#+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/htmlize.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.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://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
...@@ -11,7 +13,7 @@ ...@@ -11,7 +13,7 @@
#+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/lib/js/jquery.stickytableheaders.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script> #+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script>
Import des données * Import des données
#+begin_src python :results output :session :exports both #+begin_src python :results output :session :exports both
import numpy as np import numpy as np
...@@ -28,6 +30,7 @@ print(dataSource) ...@@ -28,6 +30,7 @@ print(dataSource)
: 19.6 21.7 11.3 15. 14.3 16.8 14. 6.8 8.2 19.9 20.4 14.6 16.4 18.7 : 19.6 21.7 11.3 15. 14.3 16.8 14. 6.8 8.2 19.9 20.4 14.6 16.4 18.7
: 16.8 15.8 20.4 15.8 22.4 16.2 20.3 23.4 12.1 15.5 15.4 18.4 15.7 10.2 : 16.8 15.8 20.4 15.8 22.4 16.2 20.3 23.4 12.1 15.5 15.4 18.4 15.7 10.2
: 8.9 21. ] : 8.9 21. ]
* Partie 1&2
La moyenne : La moyenne :
#+begin_src python :results output :session :exports both #+begin_src python :results output :session :exports both
...@@ -69,3 +72,49 @@ print(np.std(dataSource, ddof=1)) ...@@ -69,3 +72,49 @@ print(np.std(dataSource, ddof=1))
#+RESULTS: #+RESULTS:
: 4.334094455301447 : 4.334094455301447
* Partie 3
#+begin_src python :session :results file :var matplot_lib_filename="images/sequence.png" :exports both
import matplotlib.pyplot as plt
import numpy as np
w = np.arange(0, len(dataSource))
fig1 = plt.figure(figsize=(5,5))
plt.plot(list(w), list(dataSource), 'b-')
# Parameters
plt.grid(True)
plt.tight_layout()
plt.xlim(0,100)
plt.ylim(0,25)
plt.savefig(matplot_lib_filename)
matplot_lib_filename
#+end_src
#+RESULTS:
[[file:images/sequence.png]]
#+begin_src python :session :results file :var matplot_lib_filename="images/hist.png" :exports both
import matplotlib.pyplot as plt
import numpy as np
# Actual plot
fig1 = plt.figure()
plt.hist(list(dataSource), edgecolor='k')
# Parameters
plt.grid(True)
plt.tight_layout()
plt.xlim(0,25)
plt.ylim(0,25)
# Export the picture
plt.savefig(matplot_lib_filename)
matplot_lib_filename
#+end_src
#+RESULTS:
[[file:images/hist.png]]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment