Using the heights_weights_genders.csv, analyze the difference between the height weight correlation in women and men.


In [1]:
import pandas as pd
import matplotlib
%matplotlib inline

In [2]:
df = pd.read_csv('data/heights_weights_genders.csv')

In [3]:
df.head()


Out[3]:
Gender Height Weight
0 Male 73.847017 241.893563
1 Male 68.781904 162.310473
2 Male 74.110105 212.740856
3 Male 71.730978 220.042470
4 Male 69.881796 206.349801

In [4]:
df[df['Gender'] == 'Male'].corr()


Out[4]:
Height Weight
Height 1.000000 0.862979
Weight 0.862979 1.000000

In [10]:
ax = df[df['Gender'] == 'Male'].plot(kind = 'scatter', x = 'Weight', y = 'Height')
ax.set_ylim((50, 85))
ax.set_xlim((40, 280))


Out[10]:
(40, 280)

In [5]:
df[df['Gender'] == 'Female'].corr()


Out[5]:
Height Weight
Height 1.000000 0.849609
Weight 0.849609 1.000000

In [11]:
ax = df[df['Gender'] == 'Female'].plot(kind = 'scatter', x = 'Weight', y = 'Height')
ax.set_ylim((50, 85))
ax.set_xlim((40, 280))


Out[11]:
(40, 280)

In [ ]: