/ Python And R Data science skills: 85 pairplot

Sunday 18 February 2018

85 pairplot

https://vlrtraining.com/courses/python-data-science-beginner-tutorial 85 pairplot

pairplot

pairplot will plot pairwise relationships across an entire dataframe (for the numerical columns) and supports a color hue argument (for categorical columns).

In [1]:
import seaborn as sns
%matplotlib inline
tips = sns.load_dataset('tips')
tips.head(1)
Out[1]:
total_bill tip sex smoker day time size
0 16.99 1.01 Female No Sun Dinner 2
In [5]:
sns.pairplot(tips)
Out[5]:
<seaborn.axisgrid.PairGrid at 0xc1d1710>
In [6]:
sns.pairplot(tips,hue='sex')
Out[6]:
<seaborn.axisgrid.PairGrid at 0xd2f5c50>
In [4]:
sns.pairplot(tips,hue='sex',palette='coolwarm')
Out[4]:
<seaborn.axisgrid.PairGrid at 0xbcd6f60>
In [7]:
sns.pairplot(tips,hue='smoker')
Out[7]:
<seaborn.axisgrid.PairGrid at 0xeab4898>

No comments:

Post a Comment