Skip to content

Instantly share code, notes, and snippets.

@t0mst0ne
Last active August 29, 2015 14:06
Show Gist options
  • Save t0mst0ne/0b103ead3bd37084482f to your computer and use it in GitHub Desktop.
Save t0mst0ne/0b103ead3bd37084482f to your computer and use it in GitHub Desktop.
import pandas as pd
for i in range (1, 21):
data = pd.read_csv('../' + str(i) + '.csv')
delta = data["Total"] - data["First"] - data["Second"] - data["Third"]
data['delta'] = delta
data['one'] = 1
Age = data.ix[data20['County']=='TPE']
Age = pd.tools.pivot.pivot_table(Age, values='one', index=['delta'], columns=['Age'],aggfunc=np.sum, margins = False)
print Age.T.plot()
Age.T.plot().savefig('/path/to/figure.pdf')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment