Project: Analyze Box Office Data with Plotly and Python

In this project, we will be working with the TMDB Box Office Revenue Prediction data set. The motion picture industry is raking in more revenue than ever with its expansive growth the world over. Can we build models to accurately predict movie revenue? Could the results from these models be used to further increase revenue? We try to answer these questions by way of exploratory data analysis (EDA) in this project.

We will primarily use Plotly for data visualization. Plotly Python which is Plotly’s Python graphing library makes interactive, publication-quality graphs ready for both online and offline use. Built on top of the Plotly JavaScript library (plotly.js), enables Python users to create beautiful interactive web-based visualizations that can be displayed in Jupyter notebooks, saved to standalone HTML files, or served as part of pure Python-built web applications using Dash.

Join for Free
Project: Analyze Box Office Data with Plotly and Python

Duration (mins)


NA / 5


Task List

We will cover the following tasks in 58 minutes:

Introduction and Project Overview

Analyzing Movie Release Dates

In Analyze Box Office Data with Seaborn and Python we focused on exploratory data analysis. In this task, we identify the release_date column as ripe for feature engineering.

Preprocessing Features

Before we can create new features based on release_date, we need to define a function to process the dates and convert them to a standard Datetime format. We will perform data imputation to account for missing values, after which we will apply our processing on the training and test sets.

Feature Engineering Release Date

Now that we have standardized the date format, we will define a function to create new columns for the year, weekday, month, week of the year, day, and quarter.

Visualize the Number of Films Per Year with Plotly

We will use Plotly to create an interactive visualization of the number of films released per year in both the training and test sets.

We use the generic go.Scatter function from plotly.graph_objects, and specify the mode argument to choose between markers or lines.

Number of Films and Revenue Per Year

In this task, we will visualize both the number of films and total revenue per year, and the number of films vs the average revenue per year. We will be able to compare and contrast trends we observe to that of the previous task.

Do Release Days Impact Revenue?

Is it reasonable to assume that movies released on weekends will gross higher revenues? Let’s put this assumption to the test in this task by creating a categorical plot of the day of the week on the x-axis and revenue on the y-axis. Are you surprised by the results? Why or why not?

Relationship between Runtime and Revenue

We will create two plots in this task. The first describes the distribution of the duration of films. The second plots revenue against duration. Let’s find out if the data illustrates the optimal duration of a movie to maximize revenue.

Watch Preview

Preview the instructions that you will follow along in a hands-on session in your browser.

Snehan Kekre

About the Host (Snehan Kekre)

Snehan Kekre is a Machine Learning and Data Science Instructor at Coursera. He studied Computer Science and Artificial Intelligence at Minerva Schools at KGI, based in San Francisco. His interests include AI safety, EdTech, and instructional design. He recognizes that building a deep, technical understanding of machine learning and AI among students and engineers is necessary in order to grow the AI safety community. This passion drives him to design hands-on, project-based machine learning courses on Rhyme.

Frequently Asked Questions

In Rhyme, all projects are completely hands-on. You don't just passively watch someone else. You use the software directly while following the host's (Snehan Kekre) instructions. Using the software is the only way to achieve mastery. With the "Live Guide" option, you can ask for help and get immediate response.
Nothing! Just join through your web browser. Your host (Snehan Kekre) has already installed all required software and configured all data.
Absolutely! Your host (Snehan Kekre) has provided this session completely free of cost!
You can go to, sign up for free, and follow this visual guide How to use Rhyme to create your own projects. If you have custom needs or company-specific environment, please email us at
Absolutely. We offer Rhyme for workgroups as well larger departments and companies. Universities, academies, and bootcamps can also buy Rhyme for their settings. You can select projects and trainings that are mission critical for you and, as well, author your own that reflect your own needs and tech environments. Please email us at
Rhyme strives to ensure that visual instructions are helpful for reading impairments. The Rhyme interface has features like resolution and zoom that will be helpful for visual impairments. And, we are currently developing a close-caption functionality to help with hearing impairments. Most of the accessibility options of the cloud desktop's operating system or the specific application can also be used in Rhyme. If you have questions related to accessibility, please email us at
We started with windows and linux cloud desktops because they have the most flexibility in teaching any software (desktop or web). However, web applications like Salesforce can run directly through a virtual browser. And, others like Jupyter and RStudio can run on containers and be accessed by virtual browsers. We are currently working on such features where such web applications won't need to run through cloud desktops. But, the rest of the Rhyme learning, authoring, and monitoring interfaces will remain the same.
Please email us at and we'll respond to you within one business day.

Ready to join this 58 minutes session for free?

More Projects by Snehan Kekre