Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente Prochaine révision Les deux révisions suivantes | ||
python:first_course_statistics [2016/10/08 09:09] Francesco Beretta créée |
python:first_course_statistics [2016/10/09 23:01] Francesco Beretta [Histogram (p.5)] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Lessons ====== | ||
- | ===== Eruptions of the "Old Faithful" geyser (p.5) ===== | + | ====== Eruptions of the "Old Faithful" geyser (p.5) ====== |
+ | ===== Histogram (p.5) ===== | ||
+ | FB: this script works fine ! | ||
+ | <code python> | ||
+ | import pandas as pd | ||
+ | import matplotlib.pyplot as plt | ||
+ | gys1 = pd.DataFrame(pd.read_csv('../geyser1.TAB', '\t')) | ||
+ | g_int = gys1['Interval'] | ||
+ | ax = plt.gca() | ||
+ | ax.hist(g_int, bins=20, color='r') | ||
+ | ax.set_xlabel('Intereruption time') | ||
+ | ax.set_ylabel('Frequency') | ||
+ | ax.set_title('Histogram') | ||
+ | plt.show() | ||
+ | </code> | ||
- | ===== International adoption rates (p.13) ===== | + | ====== International adoption rates (p.13) ====== |