Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mooc-rr
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
da84ababf0696af51bddad556af86353
mooc-rr
Commits
f4b6cc80
Commit
f4b6cc80
authored
Nov 20, 2022
by
Louis Lacoste
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Module 2 exo 2
parent
dc8c1bfb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
1 deletion
+50
-1
exercice_python_fr.org
module2/exo2/exercice_python_fr.org
+50
-1
hist.png
module2/exo2/images/hist.png
+0
-0
sequence.png
module2/exo2/images/sequence.png
+0
-0
No files found.
module2/exo2/exercice_python_fr.org
View file @
f4b6cc80
...
...
@@ -4,6 +4,8 @@
#+LANGUAGE: fr
# #+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/readtheorg.css"/>
#+HTML_HEAD: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
...
...
@@ -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/readtheorg/js/readtheorg.js"></script>
Import des données
*
Import des données
#+begin_src python :results output :session :exports both
import numpy as np
...
...
@@ -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
: 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. ]
* Partie 1&2
La moyenne :
#+begin_src python :results output :session :exports both
...
...
@@ -69,3 +72,49 @@ print(np.std(dataSource, ddof=1))
#+RESULTS:
: 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]]
module2/exo2/images/hist.png
0 → 100644
View file @
f4b6cc80
8.65 KB
module2/exo2/images/sequence.png
0 → 100644
View file @
f4b6cc80
31.5 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment