I have accomplished this task in the field calculator (thanks to another post here, but I now realize that I need to do it using arcpy).
I have code that perfectly marks the second, third etc. duplicate(s) but I need it to mark all values that have a duplicate. Basically, I can't figure out how to mark the FIRST instance as well as the rest. Here's the code:
import arcpy
inFeatures = "thephaseIIIlayer"
fieldName = "PhaseIII_ID"
desc = arcpy.Describe(inFeatures)
fields = desc.fields
rows = arcpy.UpdateCursor("thephaseIIIlayer", "", "", "PhaseIII_ID", "PhaseIII_ID A")
i = 0
for row in rows:
if i == 0:
value = row.PhaseIII_ID
i += 1
if i > 1
row.SplitMarker = i
if row.PhaseIII_ID != value:
value = row.PhaseIII_ID
i = 1
row.SplitMarker = i -1
rows.updateRow(row)
del row
del rows