Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Introduction to Data Visualization with Plotly in Python

Cursus bekijken

Oefeninstructies

  • 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.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# 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 bewerken en uitvoeren