Skip to main content
replaced http://gis.stackexchange.com/ with https://gis.stackexchange.com/
Source Link

Thanks to PaulPaul

Here is the solution: in Pre-logic Script Code Box:

def foo(MamerMN): 
  if (MamerMN <= 0.200000): 
     return 1
  elif (MamerMN >= 0.200001 and  MamerMN <= 0.400000):
     return 2
  elif (MamerMN >= 0.400001 and  MamerMN <= 0.600000):
     return 3
  elif (MamerMN >= 0.600001 and  MamerMN <= 0.800000):
     return 4
  elif (MamerMN >= 0.800001):
     return 5

and in Expression box

foo( !MamerMN! )

Thanks to Paul

Here is the solution: in Pre-logic Script Code Box:

def foo(MamerMN): 
  if (MamerMN <= 0.200000): 
     return 1
  elif (MamerMN >= 0.200001 and  MamerMN <= 0.400000):
     return 2
  elif (MamerMN >= 0.400001 and  MamerMN <= 0.600000):
     return 3
  elif (MamerMN >= 0.600001 and  MamerMN <= 0.800000):
     return 4
  elif (MamerMN >= 0.800001):
     return 5

and in Expression box

foo( !MamerMN! )

Thanks to Paul

Here is the solution: in Pre-logic Script Code Box:

def foo(MamerMN): 
  if (MamerMN <= 0.200000): 
     return 1
  elif (MamerMN >= 0.200001 and  MamerMN <= 0.400000):
     return 2
  elif (MamerMN >= 0.400001 and  MamerMN <= 0.600000):
     return 3
  elif (MamerMN >= 0.600001 and  MamerMN <= 0.800000):
     return 4
  elif (MamerMN >= 0.800001):
     return 5

and in Expression box

foo( !MamerMN! )
added 1 character in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Thanks to Paul

Here is the solution: in Pre-logic Script Code Box:

def foo(MamerMN): 
  if (MamerMN <= 0.200000): 
     return 1
  elif (MamerMN >= 0.200001 and  MamerMN <= 0.400000):
     return 2
  elif (MamerMN >= 0.400001 and  MamerMN <= 0.600000):
     return 3
  elif (MamerMN >= 0.600001 and  MamerMN <= 0.800000):
     return 4
  elif (MamerMN >= 0.800001):
     return 5

and in CodeblockExpression box

foo( !MamerMN! )

Thanks to Paul

Here is the solution: in Pre-logic Script Code Box:

def foo(MamerMN): 
  if (MamerMN <= 0.200000): 
     return 1
  elif (MamerMN >= 0.200001 and  MamerMN <= 0.400000):
     return 2
  elif (MamerMN >= 0.400001 and  MamerMN <= 0.600000):
     return 3
  elif (MamerMN >= 0.600001 and  MamerMN <= 0.800000):
     return 4
  elif (MamerMN >= 0.800001):
     return 5

and in Codeblock box

foo( !MamerMN! )

Thanks to Paul

Here is the solution: in Pre-logic Script Code Box:

def foo(MamerMN): 
  if (MamerMN <= 0.200000): 
     return 1
  elif (MamerMN >= 0.200001 and  MamerMN <= 0.400000):
     return 2
  elif (MamerMN >= 0.400001 and  MamerMN <= 0.600000):
     return 3
  elif (MamerMN >= 0.600001 and  MamerMN <= 0.800000):
     return 4
  elif (MamerMN >= 0.800001):
     return 5

and in Expression box

foo( !MamerMN! )
Source Link
Suffii
  • 588
  • 2
  • 8
  • 20

Thanks to Paul

Here is the solution: in Pre-logic Script Code Box:

def foo(MamerMN): 
  if (MamerMN <= 0.200000): 
     return 1
  elif (MamerMN >= 0.200001 and  MamerMN <= 0.400000):
     return 2
  elif (MamerMN >= 0.400001 and  MamerMN <= 0.600000):
     return 3
  elif (MamerMN >= 0.600001 and  MamerMN <= 0.800000):
     return 4
  elif (MamerMN >= 0.800001):
     return 5

and in Codeblock box

foo( !MamerMN! )