Sabermetrics scripts for some old blog posts analyzing the 2014 Oakland A's.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
578 B

from pandas import *
teams = ['ana','ari','atl','bal',
'bos','chc','chw','cin',
'cle','col','det','fla',
'hou','kcr','lad','mil',
'min','nym','nyy','oak',
'phi','pit','sdp','sea',
'sfg','stl','tbd','tex',
'tor','wsn']
master_df = DataFrame()
for team in teams:
print "Processing team "+team
df = read_csv('data/'+team+'_team_batting.csv')
df['Team'] = team
master_df = master_df.append(df,ignore_index=True)
master_df.to_csv('data/master_team_batting.csv',index=False)
print "Done."