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

Histogram of P/E ratios

To visualize and understand the distribution of the P/E ratios in the IT sector, you can use a histogram.

The array it_pe from the previous exercise is available in your workspace.

Bu egzersiz

Introduction to Python for Finance

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

Egzersiz talimatları

  • Selectively import the pyplot module of matplotlib as plt.
  • Plot a histogram of it_pe with 8 bins.
  • Add the x-label as 'P/E ratio' and y-label as 'Frequency'.
  • Display the plot.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import matplotlib.pyplot with the alias plt
____

# Plot histogram 
plt.____(____)

# Add x-label
plt.____('P/E ratio')

# Add y-label
plt.____('Frequency')

# Show plot
____
Kodu Düzenle ve Çalıştır