Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
suyashi29
GitHub Repository: suyashi29/python-su
Path: blob/master/Visualization Seaborn.ipynb
3064 views
Kernel: Python 3

Seaborn

  • is a library for making statistical graphics in Python. It is built on top of matplotlib and closely integrated with pandas data structures.

Here is some of the functionality that seaborn offers:

  • A dataset-oriented API for examining relationships between multiple variables

  • Specialized support for using categorical variables to show observations or aggregate statistics

  • Options for visualizing univariate or bivariate distributions and for comparing them between subsets of data

  • Automatic estimation and plotting of linear regression models for different kinds dependent variables

  • Convenient views onto the overall structure of complex datasets

  • High-level abstractions for structuring multi-plot grids that let you easily build complex visualizations

  • Concise control over matplotlib figure styling with several built-in themes

  • Tools for choosing color palettes that faithfully reveal patterns in your data

Sale data Survey

  • Data Prepare

  • Insights for Sales: Person type, Product Category

  • Visualization

import pandas as pd import seaborn as sns import numpy as np import warnings # Ignore warning related to pandas_profiling warnings.filterwarnings('ignore') sns.set()
viz_data=pd.read_csv(r"https://raw.githubusercontent.com/suyashi29/python-su/master/Sale%20day.csv")
viz_data.shape
(537577, 12)
viz_data.head(2)
viz_data.describe()
viz_data.isnull().sum()
User_ID 0 Product_ID 0 Gender 0 Age 0 Occupation 0 City_Category 0 Stay_In_Current_City_Years 0 Marital_Status 286 Product_Category_1 0 Product_Category_2 166986 Product_Category_3 373297 Purchase 0 dtype: int64
sns.countplot('Gender',data=viz_data)
<matplotlib.axes._subplots.AxesSubplot at 0x199091ed9c8>
Image in a Jupyter notebook
sns.boxplot(x="Gender", y="Purchase", data=viz_data,hue="Marital_Status")
<matplotlib.axes._subplots.AxesSubplot at 0x199093af208>
Image in a Jupyter notebook
sns.violinplot(x='Marital_Status',y='Purchase',hue='Gender',data=viz_data,split=True)
<matplotlib.axes._subplots.AxesSubplot at 0x1990954f908>
Image in a Jupyter notebook