Graphique statistique

Introduction à la visualisation de données avec Matplotlib

Ariel Rokem

Data Scientist

Ajout de barres d'erreur aux diagrammes à barres

fig, ax = plt.subplots()

ax.bar("Rowing",
       mens_rowing["Height"].mean(),
       yerr=mens_rowing["Height"].std())

ax.bar("Gymnastics",
       mens_gymnastics["Height"].mean(),
       yerr=mens_gymnastics["Height"].std())

ax.set_ylabel("Height (cm)")

plt.show()
Introduction à la visualisation de données avec Matplotlib

Barres d'erreur dans un diagramme à barres

Introduction à la visualisation de données avec Matplotlib

Ajout de barres d'erreur aux graphiques

fig, ax = plt.subplots()

ax.errorbar(seattle_weather["MONTH"],
            seattle_weather["MLY-TAVG-NORMAL"],
            yerr=seattle_weather["MLY-TAVG-STDDEV"])

ax.errorbar(austin_weather["MONTH"],
            austin_weather["MLY-TAVG-NORMAL"],
            yerr=austin_weather["MLY-TAVG-STDDEV"])

ax.set_ylabel("Temperature (Fahrenheit)")

plt.show()
Introduction à la visualisation de données avec Matplotlib

Barres d'erreur dans des diagrammes

Introduction à la visualisation de données avec Matplotlib

Ajout de boîtes à moustaches

fig, ax = plt.subplots()

ax.boxplot([mens_rowing["Height"], mens_gymnastics["Height"]])
ax.set_xticklabels(["Rowing", "Gymnastics"]) ax.set_ylabel("Height (cm)") plt.show()
Introduction à la visualisation de données avec Matplotlib

Interprétation des boîtes à moustaches

Introduction à la visualisation de données avec Matplotlib

Veuillez essayer par vous-même.

Introduction à la visualisation de données avec Matplotlib

Preparing Video For Download...