Explained with examples using Seaborn
Data visualization is a very important part of data science. It is quite useful in exploring and understanding the data. In some cases, visualizations are much better than plain numbers at conveying information.
The relationships among variables, the distribution of variables, and underlying structure in data can easily be discovered using data visualization techniques.
In this post, we will learn about the 8 most commonly used types of data visualizations. I will use Seaborn to create visualizations and also try to explain what kind of information we can infer.
We will use the grocery and direct marketing datasets available on Kaggle to create the visualizations.
The grocery dataset contains information about customer purchases at grocery stores. The direct marketing dataset contains relevant data of a marketing campaign done via direct mail.
Let’s start by reading the datasets into a pandas dataframe.
import numpy as np
import pandas as pd
import seaborn as sns
sns.set(style='darkgrid')grocery = pd.read_csv("/content/Groceries_dataset.csv", parse_dates=['Date'])
The dataset contains about 40k rows and 3 columns. We have member number, date of purchase, and the purchased items as columns.
marketing = pd.read_csv("/content/DirectMarketing.csv")
The marketing dataset consists of 1000 observations (i.e. rows) and 10 features (i.e. columns). The focus is on the “AmountSpent” column which indicates how much a customer has spent so far.