Saturday, 10 September 2016

Replacing NULL value with Zero in geodatabase table using Python parser of ArcGIS field calculator?


I am having some difficulties to change "NULL" values to zero in geodatabase. I have tried the following python code in ArcGIS 10.1 ("Field Calculator") to change it but did not work.


Pre-Logic Script Code:


def RemoveNULL(x):

if x is None:
return ''
elif x == '':
return '0'
else: return x

Calculation field:


RemoveNULL(str( !DEAD_VOL_PER_HA_SPP1_125!))

Error message:



ERROR: 999999: Error executing function
The value type is incompatible with the field type. [dead_pine]
Failed to execute (calculate field)


No comments:

Post a Comment