a = [3,3,3,1,1,2,2,5,6,8,8] #the input values b = [] #temp list c = [] #duplicate value list for i in a: if len(b)< 1: b.append(i) c.append(len(b)) else: if i in b: b.append(i) c.append(len(b)) else: b = [] b.append(i) c.append(len(b))
d = {} def findDuplicates(inVal): try: d[inVal] += 1 return d[inVal] except KeyError: d[inVal] = 1 return 1
findDuplicates(!FieldA!)
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.