1

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)

3

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 Mar 6 '12 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.