Analysis of the top 10 Box Office movies of 2023 using Python

Prince Advance
5 min readMar 22, 2024

--

What was your favourite movie last year and I hope it crushed the box office. I eagerly anticipated Oppenheimer’s release and the film certainly lived up to my expectation upon its premiere. But 2023 wasn’t a one-hit wonder as Barbie premiered on the same day and exploded onto the scene, shattering box office records and becoming a pop culture phenomenon. It was peak cinema! when these two, two of the defining movies of 2023 premiered on the same day.

credit: gtaforums.com

As the months went by, Barbie and super mario kept grossing rapidly and became the highest grossing movies of the year. I thought to myself how much resources in terms of money was invested into these movies to make these huge numbers.

Data Exploration

I embarked on a quest to analyze the data about these movies using Python. All the data was collected from www.boxofficemojo.com except budget data which was collected across different web pages across the internet. The code starts by loading libraries into a jupyter notebook. We then proceed to load the file containing the dataset into our notebook, first we assign a variable to our filepath, indicating the location of the subject file. Kindly check my PrinceAdvance/Data-Analysis-With-Python (github.com) for the code to the analysis.

Snapshot of loading data

We load our data into a dataframe. After loading our data into the notebook we need to check the data is loaded correctly. From our excel file we have only 11 rows so we can go ahead and look at the whole data in our notebook.

Snapshot of movie data

The data contains the top 10 movies from the box office in 2023,their cost of production which is named ‘budget’, grossing worldwide, grossing domestically, percentage of grossing domestically, grossing from foreign counties and percentage of grossing from foreign countries in the last column.

It takes millions of dollars to make movies and when a movie is produced movie makers expect to make profit. Before we try to answer the question of how much profit each movie made, we can’t do that with dirty and unreliable data. We have to make sure our data is clean for the analysis stage.

Clean DATA, Clear ANSWERS

To clean the data we check for duplicates, missing data, outliers, etc…using the “.info()” method we can get every detail about our data. Doing that we find out our data contains no nulls and from eye observation there are no dublicates. Now we have a squeky clean data!(even without cleaning,laughs)

Snapshot result of using “.info”

Beyond the budget: Analysis and Visualization

Since the main aim of our analysis is to figure out how money invested into these movies translated into profit or worldwide grossing, we need to compare budget to the worldwide grossing. In order to do that, we need to visualize our data, results show Barbie topped the charts followed closely by Super mario bros.Movie. It can also be seen that Super mario bros.Movie, Oppenheimer and Spiderman had the lowest budgets, $100m, but became the 2nd, 3rd and 6th highest grossing movie in the year, respectively. The fast and furios franchise:Fast X recorded the highest budget in the year, making it the 8th most expensive movie ever made with a budget of $345m. The visualization below provides a vivid picture of this analysis.

Snapshot of budget versus worldwide grossing

In the same timeline, Spiderman into the Spiderverse grossed more domestically than it did internationally, in a different universe other than this it could have been different, who knows?. The little mermaid is another movie that also made more domestically than internationally. Fast X grossed more in foreign countries than it did domestically and was the least watched film in the United States among the top 10. Fascinatingly, the data shows that out of the $704,875,015 total worldwide earnings, $558,749,000 came from foreign markets. This translates to 79.3% of total earnings. Domestic earnings account for the remaining 20.7% which is $146,126,015. This shows Fast X had a bigger viewing audience outside the United States and the moviemakers must be looking forward to winning their domestic audience back. The chart below provides a better understanding.

Snapshot of domestic grossing verses international grossing

What made Barbie so unique everyone went to the theatre to watch? What made every movie unique they made staggering amounts of money?Perhaps it was nostalgia, as with the reimagining of a beloved childhood game (Super Mario Bros.)? Or maybe it was the unique vision of a director like Greta Gerwig, who brought Barbie to life in a way no one expected Or is it because it’s a biopic of a man who changed the world in a way people haven’t really thought about, with an incredible cast and director like Christopher Nolan in Oppenheimer’s case? Well, from what we found out,a lot goes into movies and a low budget can make a great movie everyone actually enjoys.

The End

2023 was an interesting year for the movie industry. Despite the strikes, which were for a good a cause by the way, movie makers had a successful year releasing riveting movies with compelling characters and plot lines.

--

--