In [13]:
%matplotlib inline

# imports needed for the following examples
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

# read a local file (path is relative to python's working directory) 
# sep, header=True/None
df = pd.read_table('house_price.txt', sep=" ", header=None, index_col=1)

# set column name
# df.columns = ['comp_code', 'comp_name', 'vendor_code', 'vendor_name', 'which_day', 'po', 'amt']


#  np.polyfit(x, y, 1)

In [14]:
df.head()


Out[14]:
0 2 3 4 5 6 7 8 9 10 11 12 13 14
1
1 NaN 1 4.9176 1 3.472 0.998 1 7 4 42 3 1 0 25.9
2 NaN 1 5.0208 1 3.531 1.500 2 7 4 62 1 1 0 29.5
3 NaN 1 4.5429 1 2.275 1.175 1 6 3 40 2 1 0 27.9
4 NaN 1 4.5573 1 4.050 1.232 1 6 3 54 4 1 0 25.9
5 NaN 1 5.0597 1 4.455 1.121 1 6 3 42 3 1 0 29.9

In [17]:
df.columns


Out[17]:
Int64Index([0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], dtype='int64')

In [24]:
x = df[3]
y = df[5]

In [25]:
plt.scatter(x, y)


Out[25]:
<matplotlib.collections.PathCollection at 0x107887828>

In [ ]: