clintoncooper

Finding Duplicates retunr the Total Number

Discussion created by clintoncooper on Oct 17, 2013
Latest reply on Oct 18, 2013 by doug.sands
I found this piece of python code that will identify the duplicates in a field and return a 1 if it finds one or more.  I updated this piece of doe changing the 1 to count in order to total all the numbers of duplicates.  Well I am trying to run this in Model Builder, and it is throwing up and error that isDuplicate is undefined.  Anyone know why this would not work in Model Builder, and might have a solution to this problem?

uniqueList = []
def isDuplicate(inValue):
  if inValue in uniqueList:
    return 1
  else:
    uniqueList.append(inValue)
    return 0


expression:  isDuplicate( !my_datafield! )


Thanks in advance!!

Outcomes