AnsweredAssumed Answered

Reclass python script not working

Question asked by jenndick12 on Aug 14, 2012
Latest reply on Mar 7, 2013 by Dcamrine
Hi,

I'm trying to reclass a vector field that has values from 1 to 7. I would like to reclass these values to 1's & 2's. For example:

if the value is 1 reclass it to 2
if the value is 2 reclass it to 2
if the value is 3 reclass it to 1

and so on.

Here is my script, but it is not working...any thoughts?

def Reclass( !Value! ):
  if ( !Value! = 1):
    return 2
  if ( !Value! = 2):
    return 2
  if ( !Value! = 3):
    return1
  if ( !Value! = 4):
    return 1
  if ( !Value! = 5):
    return 1
  if ( !Value! = 6):
    return 1
  if ( !Value! = 7):
    return 1


reclass( !Value! )

Outcomes