Skip to content

Instantly share code, notes, and snippets.

@liannewriting
Created January 18, 2020 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liannewriting/4d4287c9568e213fd1b8c9fa90ce5111 to your computer and use it in GitHub Desktop.
Save liannewriting/4d4287c9568e213fd1b8c9fa90ce5111 to your computer and use it in GitHub Desktop.
sports_betting202001
# create new variables to show home team win or loss result
df['home_win'] = np.where(df['goal_difference'] > 0, 1, 0)
df['home_loss'] = np.where(df['goal_difference'] < 0, 1, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment