In [34]:
%matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context('notebook')
In [35]:
census_data = pd.read_csv('original 2013 data.csv')
davidson_county = census_data[census_data.CTYNAME=='Davidson County']
In [42]:
populations =davidson_county[davidson_county.AGEGRP==0].TOT_POP
populations.index = np.arange(2008, 2014).astype(str)
In [72]:
fig, ax = plt.subplots()
ax.plot(100 * populations.diff()[1:].values / populations[:-1].values)
ax.set_xticks(range(5))
ax.set_xticklabels(np.arange(2009, 2014))
ax.set_ylabel('Population change (percent)')
ax.set_xlabel('Year')
Out[72]:
<matplotlib.text.Text at 0x10d09b4a8>
In [76]:
fig, ax = plt.subplots()
ax.plot(populations)
ax.set_xticklabels(np.arange(2008, 2014))
ax.set_ylim(600000, 700000)
ax.set_ylabel('Population estimate')
ax.set_xlabel('Year')
Out[76]:
<matplotlib.text.Text at 0x10e342d68>