Hello,

I'm attempting to find the duplicates in a field, then number the results sequentially within each duplicate set. I've managed increment the duplicates, but not start over when the next duplicate is hit in the code.

At 9.3, I was able to use the field_Mark_Duplicates_2.cal from Easy Calculate 5.0 (http://www.ian-ko.com/free/free_arcgis.htm). Now at 10, I need to do it in python and I'm having little success.

example of desired result:

a==>1

b==>1

c==>1

b==>2

b==>3

a==>2

Here is a snippet of code that increments all the duplicate in the table:

Any help would be greatly appreciated!!

I'm attempting to find the duplicates in a field, then number the results sequentially within each duplicate set. I've managed increment the duplicates, but not start over when the next duplicate is hit in the code.

At 9.3, I was able to use the field_Mark_Duplicates_2.cal from Easy Calculate 5.0 (http://www.ian-ko.com/free/free_arcgis.htm). Now at 10, I need to do it in python and I'm having little success.

example of desired result:

a==>1

b==>1

c==>1

b==>2

b==>3

a==>2

Here is a snippet of code that increments all the duplicate in the table:

rows = arcpy.UpdateCursor("Junk1.dbf") fields = arcpy.ListFields("Junk1.dbf" ) #Create an empty list myList = [] i = 0 for row in rows: for field in fields: if field.name == 'ID': value = row.getValue(field.name) if value in myList: i += 1 row.TEST = i rows.updateRow(row) if value not in myList: myList.append(value)

Any help would be greatly appreciated!!

a==>1

b==>1

c==>1

b==>2

b==>3

a==>4

try a matrix instead of a one D list. where you are storing [['a',1], ['b',1], ['c',1]] and incrementing the second value if it is found (to save the value) and then setting the field in that row to that value... - this is just air code so you'll have to test it out