Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created August 23, 2018 14:06
Show Gist options
  • Save lmiller1990/4e01fa148a9764d274bc50b307071646 to your computer and use it in GitHub Desktop.
Save lmiller1990/4e01fa148a9764d274bc50b307071646 to your computer and use it in GitHub Desktop.
def team_games(df, team):
"""
Returns all unique games played by a team.
Arguments:
df: the dataframe containing the data.
team: the team you are interested in. Eg: "Echo Fox"
"""
return df[
( df['team'] == team ) &
( df['player'] == 'Team' )
].drop_duplicates(subset=['gameid'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment