I have a simple calculation to compare two columns and populate a new column with the lower value but I am getting null output...any ideas?
expression
re_score(!Signal_Strength!,!Signal_Strength_1!,out1)
code block
out1='99'
def re_score(f1,f2,out1):
if f1<f2:
out1 = f1
else:
out1=f2
return out1
WARNING 000405: No records within table Succeeded at Tue Mar 06 15:13:45 2012 (Elapsed Time: 7.00 seconds)
1 Answer 1
You can evaluate your expression using a simple inline-if statement (does not require codeblock):
!Signal_Strength! if !Signal_Strength! < !Signal_Strength_1! else !Signal_Strength_1!
Or rework your codeblock:
def re_score(f1,f2):
if f1 < f2:
out1 = f1
else:
out1 = f2
return out1
with expression:
re_score(!Signal_Strength!, !Signal_Strength_1!)
-
thanks...it was a dataset issue where the model was not updating itself properly. I added out1 in "strange"/extra places for error trapping - I could search for 99.GeorgeC– GeorgeC2012年03月06日 06:19:15 +00:00Commented Mar 6, 2012 at 6:19
Explore related questions
See similar questions with these tags.