AnsweredAssumed Answered

Find Identical tool Replacement

Question asked by clintoncooper on Oct 30, 2013
Latest reply on May 30, 2014 by crrose
I am trying to l create a python script that will be a substitute to the find identical tool.  I ran it last night on a large dataset, and it is taking 10+ hours to run.  I believe I can run a search cursor and update cursor that will be light years ahead in performance.  So far, I have gotten this far with my script:

import arcpy  from arcpy import env env.workspace = r"C:\Users\cc1\Desktop\NEW.gdb\WAYNE"  table = "WAYNE"  list = []  with arcpy.da.SearchCursor(table, ["FULL_ADDRESS_NAME"]) as cursor:     for row in cursor:         list.append(row[0])  del row, cursor  with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME","FEAT_SEQ"]) as updateRows:     for updateRow in updateRows:         nameValue = updateRow[0]         if nameValue in list:             updateRow[1] = lutDict[nameValue]             updateRows.updateRow(updateRow) del updateRow, updateRows 


To be specific for what I am doing, I need to search through a field (that had duplicate values) and return a new value that is a unique number for all the different set of duplicates.  For example:

search ID   new Unique ID
aaa        1
aaa        1
bbb        2
ccc        3
ccc        3
aaa        1
ddd        4

So there would be an increment, but based if the number on the field of search ID is unique, and each successive value that is the same search ID would have the same value. 

Any thoughts on how to accomplish this?  Thanks in advance!!

Outcomes