BaşlayınÜcretsiz Başlayın

Plotting the ECDF

You will now use your ecdf() function to compute the ECDF for the petal lengths of Anderson's Iris versicolor flowers. You will then plot the ECDF. Recall that your ecdf() function returns two arrays so you will need to unpack them. An example of such unpacking is x, y = foo(data), for some function foo().

Bu egzersiz

Statistical Thinking in Python (Part 1)

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Use ecdf() to compute the ECDF of versicolor_petal_length. Unpack the output into x_vers and y_vers.
  • Plot the ECDF as dots. Remember to include marker = '.' and linestyle = 'none' in addition to x_vers and y_vers as arguments inside plt.plot().
  • Label the axes. You can label the y-axis 'ECDF'.
  • Show your plot.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Compute ECDF for versicolor data: x_vers, y_vers
____, ____ = ____(____)

# Generate plot


# Label the axes



# Display the plot

Kodu Düzenle ve Çalıştır