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])
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.