In this lesson, you’ll learn how to use Seaborn to create bar charts for statistical analysis.

Seaborn is a Python data visualization library that provides simple code to create elegant visualizations for statistical exploration and insight. Seaborn is based on Matplotlib, but improves on Matplotlib in several ways:

  • Seaborn provides a more visually appealing plotting style and concise syntax.
  • Seaborn natively understands Pandas DataFrames, making it easier to plot data directly from CSVs.
  • Seaborn can easily summarize Pandas DataFrames with many rows of data into aggregated charts.

If you’re unfamiliar with Pandas, just know that Pandas is a data analysis library for Python that provides easy-to-use data structures and allows you to organize and manipulate datasets so they can be visualized. To fully leverage the power of Seaborn, it is best to prepare your data using Pandas.

Over the next few exercises, we will explain how Seaborn relates to Pandas and how we can transform massive datasets into easily understandable graphics.



The file script.py contains code to create a Seaborn visualization. Paste the following code at the very top of script.py to import Seaborn so that the code can run successfully:

import seaborn as sns

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?