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!)
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.