Skip to content

Instantly share code, notes, and snippets.

@keyapi
Forked from bd317/vec_func
Created August 29, 2019 08:06
Show Gist options
  • Select an option

  • Save keyapi/d093349eaca4b4abf0c387e85ef3b97a to your computer and use it in GitHub Desktop.

Select an option

Save keyapi/d093349eaca4b4abf0c387e85ef3b97a 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