Skip to content

Instantly share code, notes, and snippets.

@bd317
Created August 26, 2019 17:38
Show Gist options
  • Select an option

  • Save bd317/23bcfb06afd173097ee8e68d30d1320e to your computer and use it in GitHub Desktop.

Select an option

Save bd317/23bcfb06afd173097ee8e68d30d1320e to your computer and use it in GitHub Desktop.
def soc_iter(TEAM,home,away,ftr):
df['Draws'] = 'No_Game'
df.loc[((home == TEAM) & (ftr == 'D')) | ((away == TEAM) & (ftr == 'D')), 'Draws'] = 'Draw'
df.loc[((home == TEAM) & (ftr != 'D')) | ((away == TEAM) & (ftr != 'D')), 'Draws'] = 'No_Draw'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment