Jan-12-2019, 09:06 PM
Hi
I got the added column now, that returns true/false wether the points is larger than o:points.
I have then added to it change the true/false to 1/0 so i get a integer back.
If points == o:points i want it to return 0.5 instead. How do i do that ?
I have added just part for the code. Hope its enough for it to make sense.
I have added the 2nd line (df['SUresult'] = df['points'] == df['o:points'])
That returns the true if points=o:points and the match is a draw. How can i change that true to 0.5 and how do i set up if so it will continue if its not a draw game.
/ Carsten
I got the added column now, that returns true/false wether the points is larger than o:points.
I have then added to it change the true/false to 1/0 so i get a integer back.
If points == o:points i want it to return 0.5 instead. How do i do that ?
I have added just part for the code. Hope its enough for it to make sense.
I have added the 2nd line (df['SUresult'] = df['points'] == df['o:points'])
That returns the true if points=o:points and the match is a draw. How can i change that true to 0.5 and how do i set up if so it will continue if its not a draw game.
df = pd.DataFrame.from_dict(d) df['SUresult'] = df['points'] == df['o:points'] df['SUresult'] = df['points'] > df['o:points'] # Add Straight Up results Column and see if team Won SU df['SUresult'] = df['SUresult'].astype(int) # Change the Dataframe boolan to interger 0 or 1Thanks
/ Carsten