Renaming values from one field into another.

Discussion created by Cep86 on Oct 24, 2013
Latest reply on Oct 25, 2013 by Cep86

I am very new to Python scripting and I am trying to write one that will take values (they are always consistent), and based on their value enter a string into another field.  I am working with data that is always coded the same (referenced below as field1, and I want to take those codes and automate a way to populate a different field based on those codes. 

I have been trying to play with this, but it hasn't worked so far:


Code block:
def Reclass(FIELD1):
  if (FIELD1 == "H3010"):
    return "River"

Ideally this is supposed to end up being an expression that the user can just load into the field calculator and it will grab the values from FIELD1 and place the desired values into FIELD2.