Created
August 23, 2019 11:07
-
-
Save bd317/dc816362a337b6f40f3d65c5aeb2060c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def soc_loop(leaguedf,TEAM,): | |
| leaguedf['Draws'] = 99999 | |
| for row in range(0, len(leaguedf)): | |
| if ((leaguedf['HomeTeam'].iloc[row] == TEAM) & (leaguedf['FTR'].iloc[row] == 'D')) | \ | |
| ((leaguedf['AwayTeam'].iloc[row] == TEAM) & (leaguedf['FTR'].iloc[row] == 'D')): | |
| leaguedf['Draws'].iloc[row] = 'Draw' | |
| elif ((leaguedf['HomeTeam'].iloc[row] == TEAM) & (leaguedf['FTR'].iloc[row] != 'D')) | \ | |
| ((leaguedf['AwayTeam'].iloc[row] == TEAM) & (leaguedf['FTR'].iloc[row] != 'D')): | |
| leaguedf['Draws'].iloc[row] = 'No_Draw' | |
| else: | |
| leaguedf['Draws'].iloc[row] = 'No_Game' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the dataset for this code?