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)

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Mar 6, 2012 at 5:15
0

1 Answer 1

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!)
answered Mar 6, 2012 at 5:39
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. Commented Mar 6, 2012 at 6:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.