def i(x): if x is None: return "Used to be Null" else: return x
import arcpy, os arcpy.env.workspace = "Z:\myTest.gdb" #path to your geodatabase rows = arcpy.UpdateCursor("test") #test is the name of the feature class you wish to work with for row in rows: if row.test1 == None: #test1 would be the name of the field in the feature calss row.test1 = "Used to be Null" rows.updateRow(row) del row del rows
rows = arcpy.UpdateCursor(layer) for row in rows: var = row.AREAESTIMATED if var: row.TAG = 1 else: row.TAG = 0 rows.updateRow(row)
def i(x): var = x if var: return var else: return "not null anymore"
def i(x): var = x if var: return "Used to be Null" else: return var
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.