Analyze a Movie Dataset with Python

Load, explore, and visualize a movie dataset using pandas and matplotlib.

Introduction

30 Second Summary

Every streaming service, box office tracker, and movie review site runs on data. Behind every "top grossing film" headline is someone who wrote code to crunch the numbers and spot the patterns.

In this project, you will build a Python script that loads a dataset of 20 movies, explores it with pandas, and creates a bar chart revealing which movie genres earn the most revenue.

What You'll Build

A Python data analysis script that transforms raw movie data into a visual insight using pandas and matplotlib.

By the end of this project, you'll have:

  • A working Python installation with pandas and matplotlib, plus VS Code configured as your coding environment.
  • A Python script (movies.py) that loads, explores, and summarizes a movie dataset using DataFrames.
  • A bar chart visualization generated with code that reveals which movie genres earn the most revenue.
  • Secret Mission: Add a second visualization comparing movie ratings across genres using a horizontal bar chart.

Are there any prerequisites?

None. This guide includes setup for all required tools, including Python and VS Code extensions. You do not need any prior coding experience.

Install Python and Set Up VS Code

Before you can analyze any data, you need the right tools installed on your machine. Python is the programming language you will use throughout this project to load, transform, and visualize movie data.

In this step, you will install Python, add a helpful extension to VS Code, and download the two libraries that make data analysis possible.

In this step, get ready to:
  • Install Python 3.14 on your machine.
  • Add the Microsoft Python extension to VS Code.
  • Install the pandas and matplotlib libraries.
Download and install Python 3.14

Python is the engine that runs your code. You need to download and install it from the official Python website.

Windows

  • Click the Windows installer (64-bit) download link (marked "Recommended").
  • Once the download finishes, double-click the installer file to open it.
  • At the bottom of the first installer screen, check the box that says Add python.exe to PATH.
  • Click Install Now and wait for the installation to complete.
  • Click Close when you see the "Setup was successful" message.

Why is Add python.exe to PATH important?

PATH tells your computer where to find programs when you type their name in a terminal. Without this checkbox, typing python in a terminal would return an error because your computer would not know where Python lives.

macOS

  • Click the macOS installer download link (for macOS 10.15 and later).
  • Once the download finishes, double-click the .pkg file to open the macOS Installer.
  • Click Continue through the Read Me and license screens.
  • Click Agree to accept the license terms.
  • Click Install and enter your password when prompted.
  • Click Close when the installation completes.

Why python3 instead of python on macOS?

On macOS, the Python installer creates a command called python3 rather than python. Whenever you see python in this project, use python3 instead.

The same applies to pip vs pip3.

Now verify that Python installed correctly.

  • Switch back to VS Code.
  • Open a new terminal by clicking Terminal in the top menu bar, then clicking New Terminal.
  • Check your Python version by running this command:
python --version

macOS users

Use python3 --version instead.

✔️ I see Python 3.14

You should see output like Python 3.14.6 (the last number may differ slightly). Python is installed and ready to go.

ⓧ I see an older version

An older Python installation is taking priority on your system.

  • On Windows: open Settings, select Apps, search for "Python", and uninstall the older version. Then re-run the Python 3.14 installer.
  • On macOS: the installer places Python 3.14 at /usr/local/bin/python3. Close and reopen your VS Code terminal, then try python3 --version again.

Still seeing the wrong version?

Help me fix my Python version

ⓧ Command not found

Your terminal cannot find the Python program. This usually means the PATH was not set correctly during installation.

  • On Windows: re-run the Python installer, select Modify, and make sure Add python.exe to PATH is checked. After that, close and reopen the VS Code terminal.
  • On macOS: close and reopen VS Code entirely, then open a new terminal and try python3 --version.

Still getting command not found?

Help me troubleshoot Python installation

Install the Python extension in VS Code

The Python extension gives VS Code the ability to run Python files, highlight your code, and catch errors as you type.

  • Open the Extensions panel by pressing Cmd+Shift+X (macOS) or Ctrl+Shift+X (Windows).
  • Type Python in the search bar at the top of the panel.
  • Find the extension called Python by Microsoft (it should be the first result).
  • Click Install.

What does the Python extension do?

It adds syntax highlighting (coloring your code to make it readable), a "Run" button for executing scripts, and IntelliSense (auto-complete suggestions as you type).

It also automatically installs the Pylance and Python Debugger extensions as optional dependencies.

  • Confirm you see the word Installed (or a gear icon) next to the Python extension in the Extensions panel.

Install button is greyed out?

Make sure you selected the extension published by Microsoft (look for the blue verified checkmark next to the publisher name). If you see "Reload Required", click Reload to restart VS Code with the extension active.

Help me install the Python extension

Install pandas and matplotlib

pandas is a library for working with tabular data (like spreadsheets). matplotlib is a library for creating charts and graphs.

You install both using pip, Python's built-in package manager.

  • Install both libraries by running this command in your VS Code terminal:
pip install pandas matplotlib

macOS users

Use pip3 install pandas matplotlib instead.

What does this command do?

pip install downloads packages from the Python Package Index (PyPI) and installs them on your machine. Listing two package names separated by a space installs both in one go.

You should see download progress bars followed by a "Successfully installed" message listing both packages.

  • Verify both libraries are working by running this command:
python -c "import pandas; import matplotlib; print('Ready!')"

macOS users

Use python3 instead of python at the start of the command.

  • Confirm the terminal prints Ready! with no errors.

Seeing a ModuleNotFoundError?

This means pip installed the libraries for a different Python version than the one you are running. Make sure you use the same prefix for both commands (python with pip on Windows, or python3 with pip3 on macOS).

Help me fix ModuleNotFoundError

Your development environment is ready. Next up, you will create a movie dataset and start exploring it with Python.

Create Your Movie Dataset

Your Python environment is ready to go. Now you need some data to analyze.

In this step, you will create a movie dataset directly in Python code. Building the data by hand teaches you core Python structures (dictionaries and lists) while giving you a dataset you fully understand.

In this step, get ready to:
  • Create a Python file with a movie dataset stored as a dictionary.
  • Convert the dictionary into a pandas DataFrame and preview it.
  • Explore the dataset structure and summary statistics.
Create your movie dataset and DataFrame

Every data analysis starts with data. Instead of loading an external file, you will define the dataset in your code as a Python dictionary. This teaches you how Python organizes data before pandas takes over.

  • Create a new file in VS Code by pressing Cmd+N (macOS) or Ctrl+N (Windows).
  • Save the file immediately by pressing Cmd+S (macOS) or Ctrl+S (Windows).
  • Choose your Desktop as the save location.
  • Name the file movies.py and click Save.
  • Copy the following code into movies.py:
import pandas as pd
import matplotlib.pyplot as plt

# Create the movie dataset as a dictionary
data = {
    "title": [
        "The Space Beyond", "Love in Paris", "Dark Alley",
        "Robot Wars", "Summer Nights", "The Last Heist",
        "Galaxy Quest 2", "Heart Strings", "Silent Witness",
        "Mech Overlord", "Beach Day", "The Perfect Crime",
        "Star Frontier", "Together Again", "Cold Case Files",
        "AI Uprising", "Sunset Boulevard 2", "Ocean Thieves",
        "Nebula Rising", "First Date"
    ],
    "genre": [
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance"
    ],
    "rating": [
        7.8, 6.5, 7.2,
        8.1, 7.0, 6.8,
        6.9, 7.5, 8.0,
        7.4, 6.2, 7.7,
        8.5, 6.8, 7.1,
        7.0, 7.3, 8.2,
        7.6, 6.0
    ],
    "revenue": [
        320, 95, 180,
        450, 110, 220,
        280, 85, 195,
        390, 70, 250,
        510, 120, 160,
        350, 100, 210,
        420, 75
    ]
}

# Create a pandas DataFrame
df = pd.DataFrame(data)

What does this code do?

The first two lines import the libraries you installed in Step 1. pandas handles data manipulation, and matplotlib handles charts (you will use it later).

The data variable is a Python dictionary. Each key ("title", "genre", "rating", "revenue") becomes a column name. Each value is a list of 20 entries that become the rows.

The last line, pd.DataFrame(data), converts the dictionary into a DataFrame. A DataFrame is a table structure that pandas uses to organize, filter, and analyze data.

  • Save movies.py by pressing Cmd+S (macOS) or Ctrl+S (Windows).

Seeing red underlines in VS Code?

If you see squiggly red lines under import pandas or import matplotlib, VS Code may not be using the correct Python interpreter. Click the Python version shown in the bottom-left status bar and select the interpreter that matches the Python you installed.

Help me fix red underlines in my Python imports.

Preview your data with head()

Your DataFrame exists in memory, but you cannot see it yet. The head() method prints the first 5 rows so you can quickly confirm the data looks right.

  • Add the following code to the bottom of movies.py:
# Explore the dataset
print("=== First 5 Movies ===")
print(df.head())
print()

What does this code do?

The print() statements display output in the terminal. df.head() returns the first 5 rows of your DataFrame as a formatted table. The empty print() at the end adds a blank line for readability.

  • Save movies.py.
  • Right-click anywhere in the editor and select Run Python File in Terminal.

You should see a table in the terminal showing the first 5 movies with their title, genre, rating, and revenue columns.

Don't see any output?

Make sure you saved the file before running it. If the terminal shows an error like ModuleNotFoundError, the Python interpreter VS Code is using does not have pandas installed. Click the Python version in the bottom-left status bar and switch to the interpreter where you ran pip install.

Help me fix my Python script that won't run.

Explore dataset structure and statistics

Knowing the shape of your data is essential before analysis. You need to confirm how many rows and columns exist, what data types each column holds, and what the numeric ranges look like.

  • Add the following code to the bottom of movies.py:
print("=== Dataset Info ===")
print(df.info())
print()

print("=== Summary Statistics ===")
print(df.describe())
print()

What do info() and describe() show?

The df.info() method prints a concise summary including the number of rows, column names, data types, and memory usage. It tells you whether any data is missing.

The df.describe() method computes summary statistics for numeric columns: count, mean, standard deviation, min, max, and percentiles. This gives you an instant feel for the range of your ratings and revenue values.

  • Save movies.py.
  • Right-click in the editor and select Run Python File in Terminal.

You should now see three sections of output: the first 5 movies table, dataset info showing 20 entries and 4 columns, and summary statistics including mean, min, and max values for rating and revenue.

Seeing a SyntaxError?

Check that you added the new code below the existing code, not inside the dictionary. Every print() call should be at the top level of the file (no indentation).

Help me fix a SyntaxError in my Python script.

✔️ Awesome, I've got everything!

Great. Double check that you have saved movies.py and that all three output sections appear when you run the file.

ⓧ I'd like to double check the full code

Here is the complete movies.py file so far. Compare it to yours and make sure everything matches:

import pandas as pd
import matplotlib.pyplot as plt

# Create the movie dataset as a dictionary
data = {
    "title": [
        "The Space Beyond", "Love in Paris", "Dark Alley",
        "Robot Wars", "Summer Nights", "The Last Heist",
        "Galaxy Quest 2", "Heart Strings", "Silent Witness",
        "Mech Overlord", "Beach Day", "The Perfect Crime",
        "Star Frontier", "Together Again", "Cold Case Files",
        "AI Uprising", "Sunset Boulevard 2", "Ocean Thieves",
        "Nebula Rising", "First Date"
    ],
    "genre": [
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance"
    ],
    "rating": [
        7.8, 6.5, 7.2,
        8.1, 7.0, 6.8,
        6.9, 7.5, 8.0,
        7.4, 6.2, 7.7,
        8.5, 6.8, 7.1,
        7.0, 7.3, 8.2,
        7.6, 6.0
    ],
    "revenue": [
        320, 95, 180,
        450, 110, 220,
        280, 85, 195,
        390, 70, 250,
        510, 120, 160,
        350, 100, 210,
        420, 75
    ]
}

# Create a pandas DataFrame
df = pd.DataFrame(data)

# Explore the dataset
print("=== First 5 Movies ===")
print(df.head())
print()

print("=== Dataset Info ===")
print(df.info())
print()

print("=== Summary Statistics ===")
print(df.describe())
print()

Your dataset is loaded and you can already see patterns forming in the numbers. Next up, you will use groupby to slice the data by genre and discover which genres earn more.

Analyze Your Data with Groupby

Your dataset is loaded and you have already explored it with head(), info(), and describe(). You know what columns exist, how many rows there are, and the range of ratings and revenue values.

Now for the interesting part: finding patterns. Instead of looking at all 20 movies individually, you can group them by genre and ask questions like "which genre earns the most?" pandas makes this easy with a single method called groupby().

In this step, get ready to:
  • Calculate the average revenue for each movie genre.
  • Calculate the average rating for each genre and compare the results.
Calculate average revenue by genre

The groupby() method splits your DataFrame into groups based on a column's values, then lets you run a calculation on each group. You will group by genre and calculate the mean revenue.

  • In movies.py, scroll to the bottom of the file (after the last print() statement).
  • Add the following code to calculate average revenue per genre:
# Analyze: average revenue by genre
avg_revenue = df.groupby("genre")["revenue"].mean()
print("=== Average Revenue by Genre (millions $) ===")
print(avg_revenue)
print()

What does this code do?

  • df.groupby("genre") splits all 20 movies into groups based on their genre (Sci-Fi, Romance, Thriller).
  • ["revenue"].mean() picks the revenue column from each group and calculates the average.
  • The result stored in avg_revenue is a small table with one row per genre showing that genre's average revenue.
  • Save movies.py.
  • Right-click in the editor and select Run Python File in Terminal.
  • Scroll to the bottom of the terminal output. You should see a "Average Revenue by Genre" section showing three genres with their average revenue values.

Don't see the revenue summary?

  • Make sure you added the new code after the existing print(df.describe()) block, not inside it.
  • Check that the column name in quotes matches exactly: "genre" and "revenue" (lowercase, no spaces).
  • Look for a red error message in the terminal. A KeyError means a column name is misspelled.

Still stuck? Ask for help.

Calculate average rating by genre

Revenue tells one story, but ratings tell another. A genre can be profitable without being highly rated. Adding a second groupby lets you compare both angles side by side.

  • In movies.py, add the following code directly below the revenue block you just wrote:
# Analyze: average rating by genre
avg_rating = df.groupby("genre")["rating"].mean()
print("=== Average Rating by Genre ===")
print(avg_rating)
print()

What does this code do?

  • This follows the same pattern as the revenue calculation, but targets the "rating" column instead.
  • avg_rating stores the average rating for each genre. You can compare this against avg_revenue to spot interesting patterns.
  • Save movies.py and run the file again (right-click, Run Python File in Terminal).
  • Scroll to the bottom of the output. You should see both the revenue summary and a new "Average Rating by Genre" section showing each genre's average rating on a scale of 1 to 10.

What patterns do you notice?

Sci-Fi leads in revenue but Thriller leads in ratings. The genre that earns the most is not necessarily the one audiences rate highest. This is the kind of insight that groupby aggregation reveals instantly from raw data.

Seeing a NameError for avg_rating?

  • Make sure you typed avg_rating with an underscore, not a hyphen or space.
  • Confirm the new code is below the avg_revenue block, not inside a different indentation level.

Need a hand? Ask for help.

✔️ Awesome, I've got everything!

Great. Double check you have saved movies.py before moving on.

ⓧ I'd like to double check the full code

Here is the full movies.py file at this point. Compare yours against it line by line.

import pandas as pd
import matplotlib.pyplot as plt

# Create the movie dataset as a dictionary
data = {
    "title": [
        "The Space Beyond", "Love in Paris", "Dark Alley",
        "Robot Wars", "Summer Nights", "The Last Heist",
        "Galaxy Quest 2", "Heart Strings", "Silent Witness",
        "Mech Overlord", "Beach Day", "The Perfect Crime",
        "Star Frontier", "Together Again", "Cold Case Files",
        "AI Uprising", "Sunset Boulevard 2", "Ocean Thieves",
        "Nebula Rising", "First Date"
    ],
    "genre": [
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance"
    ],
    "rating": [
        7.8, 6.5, 7.2,
        8.1, 7.0, 6.8,
        6.9, 7.5, 8.0,
        7.4, 6.2, 7.7,
        8.5, 6.8, 7.1,
        7.0, 7.3, 8.2,
        7.6, 6.0
    ],
    "revenue": [
        320, 95, 180,
        450, 110, 220,
        280, 85, 195,
        390, 70, 250,
        510, 120, 160,
        350, 100, 210,
        420, 75
    ]
}

# Create a pandas DataFrame
df = pd.DataFrame(data)

# Explore the dataset
print("=== First 5 Movies ===")
print(df.head())
print()

print("=== Dataset Info ===")
print(df.info())
print()

print("=== Summary Statistics ===")
print(df.describe())
print()

# Analyze: average revenue by genre
avg_revenue = df.groupby("genre")["revenue"].mean()
print("=== Average Revenue by Genre (millions $) ===")
print(avg_revenue)
print()

# Analyze: average rating by genre
avg_rating = df.groupby("genre")["rating"].mean()
print("=== Average Rating by Genre ===")
print(avg_rating)
print()

You have numbers that tell a clear story: Sci-Fi dominates revenue while Thriller wins on quality. Next up, you will turn these numbers into a visual chart that makes the insight instantly obvious.

Visualize Your Insights

Your groupby analysis revealed which genres earn more and which are rated higher. But staring at raw numbers makes it hard to see the full picture at a glance.

In this step, you'll turn those numbers into a bar chart that makes the genre comparison instantly visible. One look at the chart will tell the story faster than a table of averages ever could.

In this step, get ready to:
  • Create a bar chart comparing average revenue across genres.
  • Save the chart as an image file you can share.
Create a bar chart of average revenue

You already imported matplotlib's pyplot module at the top of your file. pyplot gives you functions like plt.bar() and plt.show() that let you build charts one line at a time.

  • In movies.py, scroll to the very bottom of the file (after the print(avg_rating) block).
  • Add the following code to create and display a bar chart:
# Visualize: bar chart of average revenue by genre
plt.figure(figsize=(8, 5))
plt.bar(avg_revenue.index, avg_revenue.values, color=["#2196F3", "#E91E63", "#FF9800"])
plt.xlabel("Genre")
plt.ylabel("Average Revenue (millions $)")
plt.title("Average Movie Revenue by Genre")
plt.tight_layout()
plt.show()

What does this code do?

  • plt.figure(figsize=(8, 5)) creates a new chart canvas that is 8 inches wide and 5 inches tall.
  • plt.bar() draws vertical bars. The first argument (avg_revenue.index) provides the genre names for the x-axis. The second (avg_revenue.values) provides the bar heights.
  • color=["#2196F3", "#E91E63", "#FF9800"] assigns a unique color to each bar (blue, pink, orange).
  • plt.xlabel(), plt.ylabel(), and plt.title() add readable labels so anyone can understand the chart.
  • plt.tight_layout() adjusts spacing so labels don't get cut off at the edges.
  • plt.show() opens a pop-up window displaying the finished chart.
  • Save movies.py.
  • Right-click anywhere in the editor and select Run Python File in Terminal.
  • A new window pops up showing a bar chart with three colored bars. Sci-Fi should be the tallest bar, followed by Thriller, then Romance.

No chart window appearing?

  • Make sure you saved movies.py before running. Unsaved changes won't execute.
  • Check that the new code is placed after the last print() line, not inside it.
  • The chart window may appear behind VS Code. Check your taskbar for a new Python window.

Why isn't my matplotlib chart showing up?

Save the chart as an image file

The pop-up window disappears once you close it. To keep your chart permanently, you can save it to a file before displaying it.

  • In movies.py, find this line near the bottom of your file:
plt.show()
  • Add this line directly above plt.show(), so the last two lines of your file look like this:
plt.savefig("movie_revenue.png")
plt.show()

Why does savefig come before show?

plt.show() clears the chart from memory after displaying it. If you call plt.savefig() after plt.show(), you'd save a blank image.

  • Save movies.py and run it again (right-click, Run Python File in Terminal).
  • Close the chart window once it appears.
  • Confirm the saved file exists by running this in the terminal:
ls
  • You should see movie_revenue.png listed alongside movies.py in the output.

Don't see movie_revenue.png?

  • Check that plt.savefig("movie_revenue.png") is on the line before plt.show(), not after it.
  • Make sure your terminal is in the same folder as movies.py. The file saves to whatever directory the terminal is currently in.

Help me figure out why my savefig isn't creating a file.

✔️ Awesome, I've got everything!

Great. Double check you've saved your file and that movie_revenue.png appears in your project folder.

ⓧ I'd like to double check the full code

Here is the complete movies.py file. Compare it with yours to spot any differences.

import pandas as pd
import matplotlib.pyplot as plt

# Create the movie dataset as a dictionary
data = {
    "title": [
        "The Space Beyond", "Love in Paris", "Dark Alley",
        "Robot Wars", "Summer Nights", "The Last Heist",
        "Galaxy Quest 2", "Heart Strings", "Silent Witness",
        "Mech Overlord", "Beach Day", "The Perfect Crime",
        "Star Frontier", "Together Again", "Cold Case Files",
        "AI Uprising", "Sunset Boulevard 2", "Ocean Thieves",
        "Nebula Rising", "First Date"
    ],
    "genre": [
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance", "Thriller",
        "Sci-Fi", "Romance"
    ],
    "rating": [
        7.8, 6.5, 7.2,
        8.1, 7.0, 6.8,
        6.9, 7.5, 8.0,
        7.4, 6.2, 7.7,
        8.5, 6.8, 7.1,
        7.0, 7.3, 8.2,
        7.6, 6.0
    ],
    "revenue": [
        320, 95, 180,
        450, 110, 220,
        280, 85, 195,
        390, 70, 250,
        510, 120, 160,
        350, 100, 210,
        420, 75
    ]
}

# Create a pandas DataFrame
df = pd.DataFrame(data)

# Explore the dataset
print("=== First 5 Movies ===")
print(df.head())
print()

print("=== Dataset Info ===")
print(df.info())
print()

print("=== Summary Statistics ===")
print(df.describe())
print()

# Analyze: average revenue by genre
avg_revenue = df.groupby("genre")["revenue"].mean()
print("=== Average Revenue by Genre (millions $) ===")
print(avg_revenue)
print()

# Analyze: average rating by genre
avg_rating = df.groupby("genre")["rating"].mean()
print("=== Average Rating by Genre ===")
print(avg_rating)
print()

# Visualize: bar chart of average revenue by genre
plt.figure(figsize=(8, 5))
plt.bar(avg_revenue.index, avg_revenue.values, color=["#2196F3", "#E91E63", "#FF9800"])
plt.xlabel("Genre")
plt.ylabel("Average Revenue (millions $)")
plt.title("Average Movie Revenue by Genre")
plt.tight_layout()
plt.savefig("movie_revenue.png")
plt.show()

You just turned raw data into a visual story. Your chart makes it obvious which genre dominates at the box office. Ready for a bonus challenge? The Secret Mission will push you to create a multi-panel figure comparing both revenue and ratings side by side.

Secret mission

Add a Ratings Comparison Chart

Your single bar chart tells part of the story. Can you build a two-panel figure that compares revenue AND ratings side by side? You will use matplotlib's subplot system to place two different chart types in one image.

Clean Up Your Resources

Clean Up Your Resources

This project runs entirely locally, so there are no ongoing costs. Decide whether to keep your files and tools installed, or clean them up.

Resources you used:

  • Python 3.14 installation.
  • VS Code Python extension.
  • pandas and matplotlib packages.
  • Project files: movies.py, movie_revenue.png, movie_analysis.png.

Keep everything running

No action needed. Choose this if you plan to keep learning Python or want to extend this project further.

  • Python, pandas, and matplotlib stay installed and ready for your next project.
  • Your movies.py file and chart images remain on your Desktop.
  • The VS Code Python extension stays active for any future Python work.

Pause - I'll come back to this later

Since everything is local, there is nothing to pause. Your files and tools stay on your machine until you decide to delete them.

  • No running processes to stop. Python scripts only run when you execute them.
  • Your project folder will be exactly as you left it when you return.

Delete - I don't want to use this again

Remove all project files, packages, and tools installed during this project.

  • Delete your project files by running these commands in the VS Code terminal:

macOS

cd ~/Desktop
rm movies.py movie_revenue.png movie_analysis.png

Windows

cd ~/Desktop
Remove-Item movies.py, movie_revenue.png, movie_analysis.png
  • Uninstall pandas and matplotlib by running:
pip uninstall pandas matplotlib -y
  • Uninstall the Python extension in VS Code. Open the Extensions panel (Ctrl+Shift+X on Windows or Cmd+Shift+X on macOS), find Python by Microsoft, and click Uninstall.
  • Uninstall Python itself:

macOS

Open Finder and navigate to /Applications/. Drag Python 3.14 to the Trash.

Windows

  • Open Settings.
  • Select Apps, then Installed apps.
  • Search for Python 3.14, click the three dots, and select Uninstall.

Nice Work!

Nice Work!

Nice work! You just built a complete Python data analysis pipeline that transforms raw movie data into visual insights.

You've learned how to:

  • Built a movie dataset from scratch using Python dictionaries and converted it into a pandas DataFrame for analysis.
  • Used groupby() to aggregate data by genre and discover which genres earn the most revenue versus which are rated highest.
  • Created a bar chart with matplotlib to turn numeric summaries into a visual insight and saved it as an image file.
  • Secret Mission: Built a multi-panel figure comparing revenue and ratings side by side using subplots and a horizontal bar chart.

Ready to quiz yourself?