ComenzarEmpieza gratis

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 ejercicio forma parte del curso

Introduction to Data Visualization with Plotly in Python

Ver curso

Instrucciones del ejercicio

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

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# 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 y ejecutar código