I am trying to update my attribute field based on a dictionary (join_count_dict) containing {FID:Join_Count}, (eg. {0:1,2:3,3:0,...}
The shapefile has an equal amount of FID as the dictionary, my script works occassionally, any suggestions?
with arcpy.da.UpdateCursor(shapefile, ['FID','Join_Count']) as cursor:
for row in cursor:
FID=row[0]
if FID in join_count_dict:
row[0] += join_count_dict[fid]
cursor.updateRow(row)
Any help is much appreciated!