Seaborn || sns
import seaborn as sns
import numpy as np
df = sns.load_dataset("tips")
df.head() # tip is dependent feature
# others are independent features
df.dtypes
df.corr() # correlarion can only be found out if values are floating point or integers
# corr values range b/w -1 to +1
Observations :- 1) +ve corr ->> Total bill inc then tip will also inc
sns.heatmap(df.corr())
Univariate analysis
sns.jointplot(x='tip',y='total_bill',data=df,kind='hex') # hex=hexagonal shape
sns.jointplot(x='tip',y='total_bill',data=df,kind='reg') # reg gives probablity density line(on graph) and regression line (inside plot)
sns.pairplot(df, hue='sex')
sns.distplot(df['tip'])
sns.distplot(df['tip'],kde =False,bins=10)
Count Plot
sns.countplot('sex',data=df)
Bar Plot
sns.barplot(x='total_bill',y='sex',data=df)
Box Plot
sns.boxplot('sex', 'total_bill', data=df)
sns.boxplot(x='day', y='total_bill', data=df, palette='rainbow')
sns.boxplot(data=df, orient='v')
sns.boxplot(x='total_bill', y='day', hue='smoker', data=df)
Violin Plot
sns.violinplot(x="total_bill",y='day',data=df, palette='rainbow')