Difference makes the DIFFERENCE
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(color_codes = True)
df = sns.load_dataset('diamonds')
df.head()
sns.swarmplot(x='caret')
sns.swarmplot(df.head(1000).carat)
sns.swarmplot(df.sample(500).carat)
sns.swarmplot(df.head(500).carat)
df.sample(50).head()
df.sample(5)
sns.swarmplot(df.sample(1000).price);
sns.swarmplot(df.sample(1000).carat);
sns.swarmplot(df.sample(100).price)
sns.swarmplot(df.sample(100).carat)
sns.kdeplot(df.sample(100).carat)
sns.kdeplot(df.sample(100).price)
df.info()
df500 = df.sample(500)
sns.jointplot(x = 'carat', y = 'price', data = df500)
sns.kdeplot(x='carat', y='price', data=df500)
sns.swarmplot(x='cut', y='price', data=df500);
sns.boxplot(x='carat', y='price', data=df500)
sns.boxplot(x='carat', data=df500)
sns.boxplot(x = 'price', data=df500)
sns.swarmplot(x='cut', y = 'price', data=df500)
df500.head(2)
sns.swarmplot(x='color', y='price', data=df500)
sns.swarmplot(x="clarity", y = 'price', data=df500)
pen = sns.load_dataset('penguins')
pen.head()
sns.swarmplot(x=pen.species, y = pen.bill_length_mm, data = pen)
sns.swarmplot(x=pen.island, y=pen.bill_length_mm, data=pen )
sns.swarmplot(x='island', y='bill_length_mm', data=pen, hue='species')
sns.swarmplot(x='species', y='bill_length_mm', data=pen, hue='island')
sns.swarmplot(x='species', y='body_mass_g', data=pen)
sns.swarmplot(x='body_mass_g', data=pen)
sns.stripplot(x='island', y='bill_length_mm', data = pen, color='0.3')
sns.boxplot(x='island', y='bill_length_mm', data = pen)
sns.boxplot(x='island', y='bill_length_mm', data = pen)
sns.stripplot(x='island', y='bill_length_mm', data = pen, color='0.3')
sns.boxplot(x='bill_length_mm', y='island', data = pen)
sns.stripplot(x='bill_length_mm', y='island', data = pen, color = '0.3')
flights_wide = sns.load_dataset("flights").pivot("year", "month", "passengers")
flights_wide.head()
sns.relplot(data=flights_wide, kind='line') # optios for kind are LINE and SCATTER
sns.relplot(data=flights_wide, kind='scatter')
sns.relplot(x='species', y='bill_length_mm', kind='line', data = pen, hue='island')
pen.head(2)
sns.stripplot(x='bill_length_mm', y='island', data = pen, color = '0.3')
sns.stripplot(x='bill_length_mm', y='island', data = pen, color = '0.3')
sns.boxplot(x='bill_length_mm', y='island', data = pen)