uniqueList = [] def isDuplicate(inValue): if inValue in uniqueList: return 1 else: uniqueList.append(inValue) return 0
I suggest using a cursor instead:
from collections import Counter layer = # name of layer or path to feature class with arcpy.da.UpdateCursor(layer, ["NAME", "Field"]) as cur: count = Counter(name for name, field in cur) cur.reset() for name, field in cur: cur.updateRow([name, 1 if count(name) > 1 else 0])
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.