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])
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.