Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created August 23, 2018 14:06
Show Gist options
  • Save lmiller1990/69b90b4ced019dae5414671eb4ac13ec to your computer and use it in GitHub Desktop.
Save lmiller1990/69b90b4ced019dae5414671eb4ac13ec to your computer and use it in GitHub Desktop.
fields = ['fb', 'ft', 'fd', 'fbaron']
teams = teams_by_league(df, ['nalcs'])
stats = {}
for f in fields:
status[f] = []
for team in teams:
games = team_games(df, team)
taken = games[f].sum()
total = games[f].shape[0]
stats[f].append(taken/total)
result = pd.DataFrame(stats, index=teams)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment