I'm working on building a series of updates to street feature class based on fields inside the class. I was attempting to do this with update cursor to get better performance.
When the Streets_GC_FullName is null, the STREETS_NW_SLIPRD = 2 and STREETS_NW_RAMP=1, then change the Streetname field to "Exit Ramp"
The Cursor runs for a little while but then none of the rows are actually updated. I had tried adding the print statment to see if it was stopping on those rows that matched, but none printed.
So I'm assuming that my row test is failing?
fc = r'C:\GIS\Sept2018_MergeLA.gdb\NW_GC'
fields = ['Streets_GC_FULLNAME', 'Streets_NW_FEATTYP', 'Streets_NW_SLIPRD', 'Streets_NW_RAMP', 'StreetName','Streets_NW_ID']
with arcpy.da.UpdateCursor(fc, fields) as cursor:
for row in cursor:
if (row[0] is None and row[3] == 2 and row[4] == 1):
row[5] == "Exit Ramp"
# print("Updated"+row[6])
cursor.updateRow(row)
print ("Processing complete")
row[0] is None and row[3] == 2 and row[4] == 1
. Try printing row[0], row[3] and row[4] just before you test to see if you can spot any rows that should meet the criteria. If you have many thousands to check then just add a where clause like OBJECTID < 10 onto your cursor to keep the output manageable.