ComeçarComece de graça

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.

Este exercício faz parte do curso

Introduction to Data Visualization with Plotly in Python

Ver curso

Instruções do exercício

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

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

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

# Show the plot
fig.show()
Editar e executar o código