Closed pavpatel677 closed 4 years ago
This doesn't have anything to do with hyperopt-sklearn
. You'll have better luck asking these sorts of questions on stackoverflow.
To help point you in the right direction, your calcScore
function needs to take only 1 parameter. It will end up being a list when there are multiple columns. Try something like this:
def calcScore(p):
if p[0] > p[1]:
x = 3
y = 0
elif p[0] == p[1]:
x = 1
y = 1
else:
x = 0
y = 3
return x,y
print(prem[['FTHG','FTHA']].apply(calcScore, axis=1))
This will give you what you are looking for, but the output will be a tuple (x, y) in a single column. One simple way to get around that is to have two calcScore
functions, one for x, and one for y.
I have spent ages on this and it won't work. I am trying to assign 3 points to the winning team and losing team by using the goals shown on the dataframe. I can't see to get it write as I keep on the error shown above, positional argument. Help would be a god send