I've been struggling to emulate a simple Field Calculator function as pyscript. When I try, I get parsing errors.
For example, how should this simple function (when manually applied in the Field Calculator tool) look when written up as pyscript?
In Pre-Logic Script Code:
def LookUp ( a, b ) :
if ( a == 0 ) :
newval = 0
else :
newval = b
return newval
In FIELD =
LookUp ( !MAX_RANK!, !Shape_Area! )
Any advice will be much appreciated.