Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente | Prochaine révision Les deux révisions suivantes | ||
python:first_course_statistics [2016/10/12 18:46] Beretta, Anna Letizia |
python:first_course_statistics [2016/10/13 12:52] Beretta, Anna Letizia |
||
---|---|---|---|
Ligne 44: | Ligne 44: | ||
ax.set_ylabel('Interruption time ( minutes') | ax.set_ylabel('Interruption time ( minutes') | ||
ax.set_title('Box and Whisker Plot') | ax.set_title('Box and Whisker Plot') | ||
+ | plt.show() | ||
+ | </code> | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== ScatterPlot (p. 7) ===== | ||
+ | |||
+ | AB: Put face- and edgecolor to change both of them. You can also have to different color for the in- and outside of each point. | ||
+ | |||
+ | <code python> | ||
+ | import matplotlib.pyplot as plt | ||
+ | import pandas as pd | ||
+ | geysr1_scatterplot = pd.read_csv('D:\Python\Libri\A Casebook for a First Course in Statistics and Data Analysis Datasets\Data\Tab\geyser1.TAB', '\t') | ||
+ | geysr1_data_Xax = geysr1_scatterplot['Duration'] | ||
+ | geysr1_data_Yax = geysr1_scatterplot['Interval'] | ||
+ | plt.scatter(geysr1_data_Xax, geysr1_data_Yax, facecolor='y', edgecolor='y') | ||
+ | ax = plt.gca() | ||
+ | ax.set_xlabel('Eruption duration time (minutes)') | ||
+ | ax.set_ylabel('Interuption time (minutes)') | ||
+ | ax.set_title('Scatter Plot of INTERVAL vs DURATION') | ||
plt.show() | plt.show() | ||
</code> | </code> |