calculated field with python

2496
2
Jump to solution
09-26-2012 02:38 AM
ben_abdallahmhd
New Contributor III
i would reclass an attribute ALTITUDE (float)
i use calculated field with python an i write this code of script

def reclass(ALTITUDE):
if ALTITUDE == 39,99:
  return 40


ALTITUDE=
reclass(!ALTITUDE!)
--> ok
but this error 000989 appear


where is the false please
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JasonScheirer
Occasional Contributor III
Python, like most programming languages, uses the period as the decimal separator regardless of what your local language uses.

Try this:

def reclass(ALTITUDE):
    if ALTITUDE == 39.99:
        return 40
    else:
        return ALTITUDE

View solution in original post

2 Replies
JasonScheirer
Occasional Contributor III
Python, like most programming languages, uses the period as the decimal separator regardless of what your local language uses.

Try this:

def reclass(ALTITUDE):
    if ALTITUDE == 39.99:
        return 40
    else:
        return ALTITUDE
ben_abdallahmhd
New Contributor III
thank you jscheirer it work 🙂
0 Kudos