Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created August 23, 2018 14:06
Show Gist options
  • Save lmiller1990/03be1e7c2e2b62881753d4df19b16eda to your computer and use it in GitHub Desktop.
Save lmiller1990/03be1e7c2e2b62881753d4df19b16eda to your computer and use it in GitHub Desktop.
def games_by_league(df, league):
return df[df.league.isin(league)].drop_duplicates(subset=['gameid', 'team'])
def teams_by_league(df, league="nalcs"):
data = df[df.league.isin(league)].drop_duplicates(subset=['team'])['team']
return data.values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment