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]:
In [17]:
df.columns
Out[17]:
In [24]:
x = df[3]
y = df[5]
In [25]:
plt.scatter(x, y)
Out[25]:
In [ ]: