Commit 59fd2d27 authored by ETUDIANT's avatar ETUDIANT

Update exercice_python_en.org

parent 6ea7063f
...@@ -20,6 +20,15 @@ py.init_notebook_mode(connected=True) ...@@ -20,6 +20,15 @@ py.init_notebook_mode(connected=True)
co2data = pd.read_csv("module3/exo3/monthly_in_situ_co2_mlo.csv") co2data = pd.read_csv("module3/exo3/monthly_in_situ_co2_mlo.csv")
co2data.head(11) co2data.head(11)
grp1 = co2data.groupby(["Year"]).mean()["Carbon Dioxide (ppm)"]
trace1 = go.Bar(x=grp1.index, y=grp1.values)
layout = go.Layout(
title="Average CO<sub>2</sub> Levels in Atmosphere per month",
yaxis=dict(title="Parts per million (PPM)", range=(300,420)),
xaxis=dict(title="Year"))
figure = go.Figure(data=[trace1], layout=layout)
py.iplot(figure, filename="co2-ppm-year")
Finally, an example for graphical output: Finally, an example for graphical output:
#+begin_src python :results output file :session :var matplot_lib_filename="./cosxsx.png" :exports results #+begin_src python :results output file :session :var matplot_lib_filename="./cosxsx.png" :exports results
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
......
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