ECDFs of beak depths
While bee swarm plots are useful, we found that ECDFs are often even better when doing EDA. Plot the ECDFs for the 1975 and 2012 beak depth measurements on the same plot.
For your convenience, the beak depths for the respective years has been stored in the NumPy arrays bd_1975
and bd_2012
.
Diese Übung ist Teil des Kurses
Statistical Thinking in Python (Part 2)
Anleitung zur Übung
- Compute the ECDF for the 1975 and 2012 data.
- Plot the two ECDFs.
- Set a 2% margin and add axis labels and a legend to the plot.
- Hit submit to view the plot!
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# Compute ECDFs
x_1975, y_1975 = ____
x_2012, y_2012 = ____
# Plot the ECDFs
_ = plt.____(____, ____, marker='.', linestyle='none')
_ = plt.____(____, ____, marker='.', linestyle='none')
# Set margins
____
# Add axis labels and legend
_ = plt.____('beak depth (mm)')
_ = plt.____('ECDF')
_ = plt.____(('1975', '2012'), loc='lower right')
# Show the plot
plt.show()