SEABORN - JOINT PLOTS
PadhAI ClassWork
padhai_pairplots

Joint distribution of two variables - Joint Plot

In [ ]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(color_codes = True)
In [ ]:
x = np.random.normal(size = 1000)
y = np.random.normal(size = 1000)
In [ ]:
df = pd.DataFrame({'x':x, 'y':y})
In [ ]:
sns.jointplot(x, y, data = df)
/usr/local/lib/python3.7/dist-packages/seaborn/_decorators.py:43: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning
Out[ ]:
<seaborn.axisgrid.JointGrid at 0x7f7ea26d44d0>
In [ ]:
sns.jointplot('x', 'y', data=df, kind='kde')
/usr/local/lib/python3.7/dist-packages/seaborn/_decorators.py:43: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning
Out[ ]:
<seaborn.axisgrid.JointGrid at 0x7f7e9f8c2890>
In [ ]:
x = np.random.normal(size = 1000)
y = 3 * x + np.random.normal(size = 1000)
In [ ]:
df = pd.DataFrame({'x':x, 'y':y})
In [ ]:
sns.jointplot('x', 'y', data=df, kind='kde')
/usr/local/lib/python3.7/dist-packages/seaborn/_decorators.py:43: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning
Out[ ]:
<seaborn.axisgrid.JointGrid at 0x7f7e9f2850d0>
In [ ]:
d = sns.load_dataset('diamonds')

how does the carat effect the price

In [ ]:
sns.jointplot('carat', 'price', data=d, kind='kde')
/usr/local/lib/python3.7/dist-packages/seaborn/_decorators.py:43: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning
Out[ ]:
<seaborn.axisgrid.JointGrid at 0x7f7e9f229810>
In [ ]:
sns.jointplot('carat', 'price', data=d)
/usr/local/lib/python3.7/dist-packages/seaborn/_decorators.py:43: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning
Out[ ]:
<seaborn.axisgrid.JointGrid at 0x7f7e9ec194d0>

with sample points instead of the entire diamond dataset

In [ ]:
sns.jointplot('carat', 'price', data=d.sample(500))
/usr/local/lib/python3.7/dist-packages/seaborn/_decorators.py:43: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning
Out[ ]:
<seaborn.axisgrid.JointGrid at 0x7f7e9cd45790>
In [ ]:
sns.jointplot('x', 'price', data=d.sample(500))
/usr/local/lib/python3.7/dist-packages/seaborn/_decorators.py:43: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning
Out[ ]:
<seaborn.axisgrid.JointGrid at 0x7f7e9ebdda10>
In [ ]:
sns.jointplot('x', 'price', data=d.sample(500), kind='kde')
/usr/local/lib/python3.7/dist-packages/seaborn/_decorators.py:43: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning
Out[ ]:
<seaborn.axisgrid.JointGrid at 0x7f7e9eb1cf50>
In [ ]:
!pip install nbconvert
In [ ]:
%shell jupyter nbconvert --to html /content/PadhAIdata_objects_mappings_03.ipynb
[NbConvertApp] Converting notebook /content/PadhAIdata_objects_mappings_03.ipynb to html
[NbConvertApp] Writing 382350 bytes to /content/PadhAIdata_objects_mappings_03.html
Out[ ]:

In [ ]: