diff --git a/module3/exo2/exercice_python_fr.org b/module3/exo2/exercice_python_fr.org index c0c7481cb24999310f30cb60433e8af9226f9b40..58beab2d5b22defcb2f500dc41b9733946cc21bf 100644 --- a/module3/exo2/exercice_python_fr.org +++ b/module3/exo2/exercice_python_fr.org @@ -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: