In [12]:
import pandas as pd
import matplotlib.pyplot as plt
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [3]:
data = pd.read_csv("hubble_data.csv")

In [5]:
data.head()


Out[5]:
distance recession_velocity
0 0.032 170
1 0.034 290
2 0.214 -130
3 0.263 -70
4 0.275 -185

In [9]:
headers = ["distance","recession_velocity"]
data2 = pd.read_csv("hubble_data_no_headers.csv", names = headers)

data2.head()


Out[9]:
distance recession_velocity
0 0.032 170
1 0.034 290
2 0.214 -130
3 0.263 -70
4 0.275 -185

In [10]:
data2.set_index("distance", inplace=True)
data2.head()


Out[10]:
recession_velocity
distance
0.032 170
0.034 290
0.214 -130
0.263 -70
0.275 -185

In [13]:
data2.plot()
plt.show()



In [ ]: