AnsweredAssumed Answered

Python problem 'Calculate Field'

Question asked by veroteruel on Aug 8, 2012
Latest reply on Aug 8, 2012 by Dan_Patterson
Hi all,
I'm just starting with Python and I'm a bit stuck... so sorry if the question is very basic, but I cannot find it anywhere. I'm working with ArcGis 9.3

I am developing a model builder, in one step I have to calculate a field (field3) based on two other different fields, lets say
[FIELD_1= a, b, c, d???] and [FIELD_2= 1, 2, 3..].

From here no problem, the point is that FIELD_3 takes different values depending on Field_1 value.
For one unique value in FIELD_1 I have the following code working properly

def Reclass(FIELD_2):
  if (FIELD_2 < 92):
    return 0
  elif (FIELD_2 >= 92 and FIELD_2 < 93.5):
    return 1
  elif (FIELD_2 >= 93.5):
    return 2

The problem is that I don???t know how to add that if ???FIELD_1== 1 or 2 or 4??? do the calculation above, but if FIELD_1 == 3, 5, 7 do a different one.

Any help would be really helpful
Thank you very much in advance!!