2

I'm using ArcGIS 10.3 and I want to create classes (1-4) in a field called "Util_Class" based on the values of a field called "OverallUtil". I think I have syntax error and have been entering this into the Field Calculator:

def Reclass (!Util_Class!):
  if (!OverallUtil! <= 0.6):
    return 1
  elif ( !OverallUtil!>0.6 and !OverallUtil!<= 0.75):
    return 2
  elif ( !OverallUtil!>0.75 and !OverallUtil!<=0.90):
    return 3
  elif (!OverallUtil! > 0.90):
    return 4

enter image description here

6

You need to use the Codeblock - see above your code box there's a button that says "Show Codeblock". Check that, and you can enter your code into the codeblock.

def myReclass(overallUtil):
  if (overallUtil <= 0.6):
    return 1
  elif (overallUtil > 0.6 and overallUtil <= 0.75):
    return 2
  elif (overallUtil > 0.75 and overallUtil <=0.90):
    return 3
  elif (overallUtil > 0.90):
    return 4

and in the expression box below it enter

myReclass(!OverallUtil!)

Note I have made a couple of changes to your code

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.