Relational Plots in Seaborn

Machine Learning courses with 100+ Real-time projects Start Now!!

Program 1

Seaborn Dataset

import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt

df_sales=pd.read_excel("D://scikit_data/Sale/sales.xlsx")
df_sales.head()

df_sales.info()

df_sales.isnull().sum()

df_sales.shape

sns.relplot(x='Sales',y='Profit',data=df_sales,hue='Order Priority',style='Ship Mode')

sns.relplot(x='Sales',y='Profit',data=df_sales,size='Discount')

sns.relplot(x='Sales',y='Profit',data=df_sales,size='Discount',sizes=(20,200),hue='Order Priority')

df_tips=pd.read_csv("D://scikit_data/Billing/tips.csv")

df_tips.head()

df_tips.info()

df_tips.shape

sns.relplot(x='tip',y='total_bill',data=df_tips,hue='sex',hue_order=['Male','Female'])

sns.relplot(x='tip',y='size',data=df_tips,hue='day')

df_sales.info()

sns.relplot(x='Sales',y='Profit',data=df_sales,col='Customer Segment',col_wrap=2,hue='Ship Mode')

sns.relplot(x='Sales',y='Profit',data=df_sales,hue='Region',col='Customer Segment',row='Product Category')

 

Your opinion matters
Please write your valuable feedback about DataFlair on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *