I'm working with some county level data for the 2016 US Election.
I'm trying to calculate a blank Text field "Winner" based on two numeric fields "votes_dem" and "votes_gop" where it will take the greater of the two values in the numeric fields and input either "Trump" or "Clinton" into the new Winner field.
When I try to run my code block it returns with this warning:
WARNING 002858: Certain rows set to NULL due to error while evaluating Python expression: File "", line 2, in Reclass
I think there's a problem with my syntax, or just the way I'm trying to do it in general (still learning Python)
Wnner = Reclass(!Winner!)
def Reclass(Winner):
if (votes_gop > votes_dem):
return Trump
elif (votes_dem > votes_gop):
return Clinton