In [51]:
import pandas as pd
import matplotlib.pyplot as plt
%pylab inline
%cd "C:\Users\eshatiw\Documents\IPython Notebooks\a"
In [52]:
headers = ["year", "visitors"]
v = pd.read_csv("visitors.csv", skiprows = 5, names = headers)
v.head()
Out[52]:
In [53]:
headers2 = ["year", "visitors_new"]
v1 = pd.read_csv("visitors-new.csv", skiprows = 5, names = headers2)
v1.head()
Out[53]:
In [54]:
headers3 = ["year", "visitors_uni"]
v2 = pd.read_csv("visitors-unique.csv", skiprows = 5, names = headers3)
v2.head()
Out[54]:
In [55]:
comb1 = pd.merge(v, v1)
comb1.head()
Out[55]:
In [56]:
comb = pd.merge(comb1, v2)
comb.head()
Out[56]:
In [57]:
comb.sort(['year'], inplace=True)
comb.head()
Out[57]:
In [58]:
comb.set_index(['year'], inplace=True)
comb.head()
Out[58]:
In [59]:
comb.plot()
plt.show()
In [62]:
#pd.to_datetime(comb.index) > pd.to_datetime('2014-11-1')
comb_new = comb[pd.to_datetime(comb.index) > pd.to_datetime('2014-11-1')]
comb_new.head()
Out[62]:
In [64]:
comb_new.plot()
plt.show()
In [60]: