Data Visualization with Python (12): Seaborn

Sawsan Yusuf
4 min readJun 18, 2023

There are many ways to visualize data. And as I mentioned in the previous article, we use four libraries for making visualizations: pandas, Matplotlib, plotly express, and Seaborn. In the past articles, we learned about Matplotlib and Plotly Express. In this article, we’ll focus on using Seaborn. So, what is Seaborn?

Seaborn is a library primarily used for statistical plotting in Python. It is built on top of Matplotlib and provides beautiful default styles and color palettes to make statistical plots more attractive.

We can import the Seaborn library with the allies “sns” in this way:

import seaborn as sns

First of all, let’s look at the data we will use in this article.

Dataset: Automobile Prices

We will be using the car prices dataset from UC Irvine Machine Learning Repository.

# Import required libraries
import pandas as pd
import seaborn as sns

# Read the airline data into pandas dataframe
df = pd.read_csv('carprices_data.csv')

# Preview the first 5 lines of the loaded data
df.head()

--

--