diff --git a/module3/exo3/exercice_python_en.org b/module3/exo3/exercice_python_en.org index 2fe11f562a165228048815dbd220bd0e0a69a75a..834456fb6c50ab58e73c9d975e4f731a47711386 100644 --- a/module3/exo3/exercice_python_en.org +++ b/module3/exo3/exercice_python_en.org @@ -20,6 +20,15 @@ py.init_notebook_mode(connected=True) co2data = pd.read_csv("module3/exo3/monthly_in_situ_co2_mlo.csv") 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 CO2 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: #+begin_src python :results output file :session :var matplot_lib_filename="./cosxsx.png" :exports results import matplotlib.pyplot as plt