Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. FieldA FieldB
  2.  
  3. 1 0
  4.  
  5. 2 1
  6.  
  7. 2 1
  8.  
  9. 3 0
  10.  
  11. with arcpy.da.UpdateCursor(featureClass, ("FieldA", "FieldB")) as cursor:
  12.  
  13. for rupd in cursor:
  14.  
  15. rows = [row for row in arcpy.SearchCursor(featureClass, 'FieldA=' + str(rupd[0]) )]
  16.  
  17. if len(rows)>1:
  18. rupd[1]=0
  19. else:
  20. rupd[1]=1
  21.  
  22. cursor.updateRow(rupd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement