In [1]:
%pylab inline
pylab.style.use('ggplot')
import pandas as pd
import numpy as np


Populating the interactive namespace from numpy and matplotlib

In [20]:
url = 'http://www.stat.ufl.edu/~winner/data/millcost.dat'
data_df  = pd.read_csv(url, header=None, sep='\s+')

In [22]:
data_df.columns = ['month', 'production', 'cost']

In [23]:
data_df.head()


Out[23]:
month production cost
0 1 46.75 92.64
1 2 42.18 88.81
2 3 41.86 86.44
3 4 43.29 88.80
4 5 42.12 86.38

In [24]:
import seaborn as sns
sns.jointplot(x='production', y='cost', data=data_df)


Out[24]:
<seaborn.axisgrid.JointGrid at 0x20657812ba8>

In [57]:
sns.regplot(x='production', y='cost', data=data_df)
pylab.title('Linear regression: cost ~ production')


Out[57]:
<matplotlib.text.Text at 0x2065d357128>

In [59]:
sns.residplot(x='production', y='cost', data=data_df)
pylab.title('cost ~ production: Residuals')


Out[59]:
<matplotlib.text.Text at 0x2065d442358>