Search⌘ K
AI Features

Exercise: Cumulative Univariate Analysis

Explore how to perform cumulative univariate analysis with Plotly in Python. This lesson guides you through creating box plots, histograms, cumulative histograms, violin plots, and ECDFs using real movie dataset examples to enhance your data visualization skills.

Exercise 1

For this exercise, please use the top_movies.csv dataset that details the highest-grossing films in the United States and Canada.

Create a box plot using Plotly Express showing the distribution of the adjusted gross (adjusted) column.

Solution

  • The below code creates a box plot using Plotly Express, where the x-axis represents the Adjusted column of the movies dataset.

  • On line 2, the px.box() function is used to create the boxplot, where the data_frame parameter specifies the dataset, and the x parameter specifies the column to use for the x-axis.

Python 3.5
# Create and show figure
fig = px.box(data_frame=movies, x="Adjusted")
fig.show()

Exercise 2

For this exercise, please use Plotly graph ...