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
23db65e7e2b5fb82db5e83fb70a96150
mooc-rr
Commits
77f8ef86
Commit
77f8ef86
authored
Apr 27, 2020
by
escuiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
passage des données en format pd.dataframe avec datetimeindex
parent
576dc1ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
exercice_python_fr.org
module3/exo2/exercice_python_fr.org
+31
-3
No files found.
module3/exo2/exercice_python_fr.org
View file @
77f8ef86
...
...
@@ -142,10 +142,11 @@ librairie pandas.
** Visualisation au pas semaine
#+begin_src python :results
value
:session :exports both
#+begin_src python :results
output
:session :exports both
import pandas
data = pandas.DataFrame(converted_data, columns=("Date", "Incidence"))
fig = data.plot(x="Date", y="Incidence")
data.set_index(pandas.to_datetime(data["Date"]), inplace=True)
fig = data.plot()
plt.savefig("incidence_hebdo_varicelle.png")
#+end_src
...
...
@@ -153,5 +154,32 @@ plt.savefig("incidence_hebdo_varicelle.png")
[[file:"incidence_hebdo_varicelle.png"]]
** Visualisation au pas année
Zoom sur une année pour situer à quel mois se situe de pic annuel.
#+begin_src python :results output :session :exports both
#print(data.index)
fig2 = data["2002-01-01":"2002-12-31"].plot()
plt.savefig("incidence_hebdo_varicelle_2002.png")
#+end_src
#+RESULTS:
[[file:"incidence_hebdo_varicelle_2002.png"]]
Le pic semble être au printemps de chaque année, légèrement plus tard
que le pic de grippe.
** Analyse année par année
La période de référence commence au 1er septembre. La période
commençant en septembre de l'année N a l'étiquette N+1 car le pic
annuel se situe en début/printemps de l'année N+1 (sur le modèle
de l'analyse du syndrome grippal dans le mooc).
#+begin_src python :results output :session :exports both
incidence_annuelle = pandas.DataFrame()
#+end_src
#+RESULTS:
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