Skip to content

Visualizing video game sales data

The dataset used in this workspace is a subset of the data found here. It contains records of popular video games in North America, Japan, Europe and other parts of the world. Every video game in this dataset has at least 100k global sales.

The hidden code below aggregates platform sales across North America, Japan, and Europe, and prepares them for visualization using a chart cell.

# Import pandas and read in the data
import pandas as pd
df = pd.read_csv("console_sales.csv")

# Aggregate the data by "Platform" and then melt the DataFrame for plotting
df_agg = df.groupby("Platform", as_index=False)["Platform", "NA_Sales", "EU_Sales", "JP_Sales"].sum()
df_melt = df_agg.melt(id_vars="Platform", var_name="Region", value_name="Sales")

# Preview the resulting DataFrame
df_melt

Next, we use a chart cell to create a grouped bar chart of the data.

  • We select the DataFrame to use (df_melt).
  • We select Platform to be on the x-axis.
  • We select Sales to be on the y-axis.
  • We group the data by Region.
  • Finally, we edit the title to give an accurate description of the chart!
Current Type: Bar
Current X-axis: Platform
Current Y-axis: Sales
Current Color: Region

Worldwide sales of eight generation video game platforms

Play around with the data, and try using a chart cell to create your own visualizations! Be sure to experiment with the chart type and columns you map to the x-axis, y-axis, and group by.

Want to analyze and visualize different data? Select a dataset of your own and get started!

Spinner
DataFrameas
df
variable