LoslegenKostenlos loslegen

Histogram of company revenues

The New York Stock Exchange firm loved your previous box plot and wants you to do more work for them.

The box plot was a perfect visualization to help them understand their company revenue dataset's outliers and quartile-related attributes.

However, they want to understand a bit more about the data distribution. Are there many companies with smaller revenue or larger revenue? Is it somewhat bell-shaped or skewed towards higher or lower revenues?

In this exercise, you will help the investment team by creating a histogram of the revenue of top US companies.

There is a revenues DataFrame already loaded for your use.

Diese Übung ist Teil des Kurses

Introduction to Data Visualization with Plotly in Python

Kurs anzeigen

Anleitung zur Übung

  • Create a histogram using px.histogram() and the appropriate DataFrame.
  • Set the column Revenue to be used along the x-axis.
  • Set the number of bins to 5.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Create a simple histogram
fig = px.histogram(
  			data_frame=____, 
            # Set up the x-axis
           	____="____",
            # Set the number of bins
            ____=____)

# Show the plot
fig.show()
Code bearbeiten und ausführen