<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Find Identical tool Replacement in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384187#M30256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy&amp;nbsp; from arcpy import env env.workspace = r"C:\Users\cc1\Desktop\NEW.gdb\WAYNE"&amp;nbsp; table = "WAYNE"&amp;nbsp; list = []&amp;nbsp; with arcpy.da.SearchCursor(table, ["FULL_ADDRESS_NAME"]) as cursor: &amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.append(row[0])&amp;nbsp; del row, cursor&amp;nbsp; with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME","FEAT_SEQ"]) as updateRows: &amp;nbsp;&amp;nbsp;&amp;nbsp; for updateRow in updateRows: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = updateRow[0] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nameValue in list: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[1] = lutDict[nameValue] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow) del updateRow, updateRows &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a good start. A few things though. For one, I would avoid naming any variables you define things like list, dict etc that might get confused with list(), dict() etc. Also, you will probably throw errors because you are calling the row variable &lt;/SPAN&gt;&lt;STRONG&gt;updateRow&lt;/STRONG&gt;&lt;SPAN&gt; but also calling the method &lt;/SPAN&gt;&lt;STRONG&gt;updateRow&lt;/STRONG&gt;&lt;SPAN&gt;. This is generally a bad idea, you should keep names unique so the code is clear.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But your general idea is almost right on. My thought would be that you only need the update cursor, you can do without the first cursor if you use a dictionary instead of a list to store the values. Try this (granted that I can't test it for myself):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy&amp;nbsp; from arcpy import env env.workspace = r"C:\Users\cc1\Desktop\NEW.gdb\WAYNE"&amp;nbsp; table = "WAYNE"&amp;nbsp; uniqueValues = {} newID = 1&amp;nbsp; with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME","FEAT_SEQ"]) as updateRows: &amp;nbsp;&amp;nbsp;&amp;nbsp; for row in updateRows: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = row[0] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nameValue in uniqueVals: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = uniqueValues[nameValue] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newID += 1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueValues[nameValue] = newID &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = newID &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del row, updateRows&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And you are right about the cursors - in general they tend to be much faster.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Oct 2013 12:43:31 GMT</pubDate>
    <dc:creator>DouglasSands</dc:creator>
    <dc:date>2013-10-30T12:43:31Z</dc:date>
    <item>
      <title>Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384186#M30255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to l create a python script that will be a substitute to the find identical tool.&amp;nbsp; I ran it last night on a large dataset, and it is taking 10+ hours to run.&amp;nbsp; I believe I can run a search cursor and update cursor that will be light years ahead in performance.&amp;nbsp; So far, I have gotten this far with my script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy&amp;nbsp; from arcpy import env env.workspace = r"C:\Users\cc1\Desktop\NEW.gdb\WAYNE"&amp;nbsp; table = "WAYNE"&amp;nbsp; list = []&amp;nbsp; with arcpy.da.SearchCursor(table, ["FULL_ADDRESS_NAME"]) as cursor: &amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.append(row[0])&amp;nbsp; del row, cursor&amp;nbsp; with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME","FEAT_SEQ"]) as updateRows: &amp;nbsp;&amp;nbsp;&amp;nbsp; for updateRow in updateRows: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = updateRow[0] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nameValue in list: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[1] = lutDict[nameValue] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow) del updateRow, updateRows &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&amp;nbsp; For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;search ID&amp;nbsp;&amp;nbsp; new Unique ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aaa&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aaa&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;bbb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ccc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ccc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aaa&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ddd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts on how to accomplish this?&amp;nbsp; Thanks in advance!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 12:28:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384186#M30255</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2013-10-30T12:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384187#M30256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy&amp;nbsp; from arcpy import env env.workspace = r"C:\Users\cc1\Desktop\NEW.gdb\WAYNE"&amp;nbsp; table = "WAYNE"&amp;nbsp; list = []&amp;nbsp; with arcpy.da.SearchCursor(table, ["FULL_ADDRESS_NAME"]) as cursor: &amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.append(row[0])&amp;nbsp; del row, cursor&amp;nbsp; with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME","FEAT_SEQ"]) as updateRows: &amp;nbsp;&amp;nbsp;&amp;nbsp; for updateRow in updateRows: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = updateRow[0] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nameValue in list: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow[1] = lutDict[nameValue] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow) del updateRow, updateRows &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a good start. A few things though. For one, I would avoid naming any variables you define things like list, dict etc that might get confused with list(), dict() etc. Also, you will probably throw errors because you are calling the row variable &lt;/SPAN&gt;&lt;STRONG&gt;updateRow&lt;/STRONG&gt;&lt;SPAN&gt; but also calling the method &lt;/SPAN&gt;&lt;STRONG&gt;updateRow&lt;/STRONG&gt;&lt;SPAN&gt;. This is generally a bad idea, you should keep names unique so the code is clear.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But your general idea is almost right on. My thought would be that you only need the update cursor, you can do without the first cursor if you use a dictionary instead of a list to store the values. Try this (granted that I can't test it for myself):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy&amp;nbsp; from arcpy import env env.workspace = r"C:\Users\cc1\Desktop\NEW.gdb\WAYNE"&amp;nbsp; table = "WAYNE"&amp;nbsp; uniqueValues = {} newID = 1&amp;nbsp; with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME","FEAT_SEQ"]) as updateRows: &amp;nbsp;&amp;nbsp;&amp;nbsp; for row in updateRows: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = row[0] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nameValue in uniqueVals: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = uniqueValues[nameValue] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newID += 1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueValues[nameValue] = newID &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = newID &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del row, updateRows&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And you are right about the cursors - in general they tend to be much faster.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 12:43:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384187#M30256</guid>
      <dc:creator>DouglasSands</dc:creator>
      <dc:date>2013-10-30T12:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384188#M30257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This worked great!&amp;nbsp; Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now if I wanted to find all the duplicates and sum them up, and print that value for each record (basically a like the Frequency tool)&amp;nbsp; what would I need to change to get that to work?&amp;nbsp; Thanks again!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Clinton&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 13:59:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384188#M30257</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2013-10-30T13:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384189#M30258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00080000001z000000"&gt;Summary Statistics&lt;/A&gt;&lt;SPAN&gt; tool works exactly like frequency if you specify the inputs correctly, and it only requires ArcGIS Basic (ArcEditor). The python syntax is available at the link.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 15:24:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384189#M30258</guid>
      <dc:creator>DouglasSands</dc:creator>
      <dc:date>2013-10-30T15:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384190#M30259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00080000001z000000"&gt;Summary Statistics&lt;/A&gt; tool works exactly like frequency if you specify the inputs correctly, and it only requires ArcGIS Basic (ArcEditor). The python syntax is available at the link.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;well I am looking for a python data cursor solution for better performance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 15:45:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384190#M30259</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2013-10-30T15:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384191#M30260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Summary statistics is written in C++. It will be significantly faster than any Python solution.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 15:48:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384191#M30260</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2013-10-30T15:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384192#M30261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Summary statistics is written in C++. It will be significantly faster than any Python solution.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;even with having to add/join the data back into the original table?&amp;nbsp; What I have been doing, is running the Frequency Tool (which creates a new table)&amp;nbsp; and then using a search and update cursor to get the data back into the original file.&amp;nbsp; I guess I am wondering if it would be faster to run a cursor in the original file that calculates the "frequency" and updates the data directly into the original table?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 15:54:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384192#M30261</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2013-10-30T15:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384193#M30262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you really want to do it all in python, as a first step, add a field called 'FREQ' to the table. Then run this modified version of the above code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

from arcpy import env
env.workspace = r"C:\Users\cc1\Desktop\NEW.gdb\WAYNE"

table = "WAYNE"

uniqueValues = {}
values = []
newID = 1

with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME","FEAT_SEQ"]) as updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.append(nameValue)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nameValue in uniqueVals:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = uniqueValues[[nameValue]]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newID += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueValues[nameValue] = [newID]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = newID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del row, updateRows

uniqueCount = {}
for val in uniqueValues:
&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueCount[val] = values.count(val)

with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME", "FREQ"]) as updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = uniqueCount[nameValue]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del row, updateRows
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The arcpy.da.UpdateCursor is definitely faster than the field calculator tool, at least in my testing (if you were going to summarize -&amp;gt; join -&amp;gt; calculatefield -&amp;gt; remove join), can't say that they will be than the summary stats alone.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:40:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384193#M30262</guid>
      <dc:creator>DouglasSands</dc:creator>
      <dc:date>2021-12-11T17:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384194#M30263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If you really want to do it all in python, as a first step, add a field called 'FREQ' to the table. Then run this modified version of the above code:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

from arcpy import env
env.workspace = r"C:\Users\cc1\Desktop\NEW.gdb\WAYNE"

table = "WAYNE"

uniqueValues = {}
values = []
newID = 1

with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME","FEAT_SEQ"]) as updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.append(nameValue)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nameValue in uniqueVals:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = uniqueValues[[nameValue]]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newID += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueValues[nameValue] = [newID]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = newID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del row, updateRows

uniqueCount = {}
for val in uniqueValues:
&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueCount[val] = values.count(val)

with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME", "FREQ"]) as updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = uniqueCount[nameValue]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del row, updateRows
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;The arcpy.da.UpdateCursor is definitely faster than the field calculator tool, at least in my testing (if you were going to summarize -&amp;gt; join -&amp;gt; calculatefield -&amp;gt; remove join), can't say that they will be than the summary stats alone.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Doug for the help!&amp;nbsp; On my main file it takes about 10 minutes to run the summarize tool, and another 24 to update it, taking a total time of 34 minutes.&amp;nbsp; I will run this script and report back if the script is faster.&amp;nbsp; Again, thanks for the help.&amp;nbsp; What good resources would you suggest to help with my learning curve in python for acrgis?&amp;nbsp; I do have the python scripting for ArcGIS book, but it only goes over the very basics, and I am now starting to get into deeper code writing.&amp;nbsp; Thanks again!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:40:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384194#M30263</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2021-12-11T17:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384195#M30264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

from arcpy import env
env.workspace = r"C:\Users\cc1\Desktop\NEW.gdb\WAYNE"

table = "WAYNE"

uniqueValues = {}
values = []
newID = 1

with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME","FEAT_SEQ"]) as updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.append(nameValue)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nameValue in uniqueVals:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = uniqueValues[[nameValue]]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newID += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueValues[nameValue] = [newID]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = newID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del row, updateRows

uniqueCount = {}
for val in uniqueValues:
&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueCount[val] = values.count(val)

with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME", "FREQ"]) as updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = uniqueCount[nameValue]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del row, updateRows
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ran the code, and it is throwing a zero into the FREQ field for all values?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:40:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384195#M30264</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2021-12-11T17:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384196#M30265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure. Although now that I think about it, I have had trouble in the past assigning values to a row directly from a dictionary. Try this? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

from arcpy import env
env.workspace = r"C:\Users\cc1\Desktop\NEW.gdb\WAYNE"

table = "WAYNE"

uniqueValues = {}
values = []
newID = 1

with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME","FEAT_SEQ"]) as updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.append(nameValue)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nameValue in uniqueVals:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = uniqueValues[[nameValue]]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newID += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueValues[nameValue] = [newID]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = newID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del row
del updateRows

uniqueCount = {}
for val in uniqueValues:
&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueCount[val] = values.count(val)

with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME", "FREQ"]) as updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count = uniqueCount[nameValue]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = count
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del row
del updateRows

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If that doesn't work, try inserting a print statement and printing values after the first cursor to see if it gets populated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For resources, as someone who taught myself also I found that in general the ESRI online help for each tool has all of the syntax information you need for tools and always has examples. Thats the first place I go when I can't figure something out. Quickly googling "arcpy 10.1 &amp;lt;tool name&amp;gt;" usually gets good results. Also searching the web in general - lots of people have asked lots of questions that have been answered all over the place.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:40:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384196#M30265</guid>
      <dc:creator>DouglasSands</dc:creator>
      <dc:date>2021-12-11T17:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384197#M30266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;added this line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
values = [row[0] for row in arcpy.da.SearchCursor(table, ("FULL_ADDRESS_NAME"))]
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and it worked with this code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

from arcpy import env
env.workspace = r"C:\Users\ccooper\Desktop\DATA.gdb\WAYNE"

table = "WAYNE"

uniqueValues = {}
values = [row[0] for row in arcpy.da.SearchCursor(table, ("FULL_ADDRESS_NAME"))]
newID = 0

with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME","FEAT_SEQ"]) as updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nameValue in uniqueValues:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = uniqueValues[nameValue]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newID += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueValues[nameValue] = newID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = newID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del row, updateRows

uniqueCount = {}
for val in uniqueValues:
&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueCount[val] = values.count(val)

with arcpy.da.UpdateCursor(table, ["FULL_ADDRESS_NAME", "FREQ_NAME"]) as updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in updateRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameValue = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = uniqueCount[nameValue]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del row, updateRows
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;on my test data (1/100th) the size of my main file, it ran for 85 seconds.....much slower than my other method.&amp;nbsp; Do you see any in efficiencies in my code that I could change to increase performance?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:40:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384197#M30266</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2021-12-11T17:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384198#M30267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Summary statistics is written in C++. It will be significantly faster than any Python solution.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not completely true... The Summary Stats tool (and Frequency tool) seems to run a pre-sort on the dataset as step 1 (at least that's what the tool status says it's doing), which doesn't seem to be neccessary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The out of the box Summary Statistics tool takes 13 seconds to get the maximum OBJECTID value for each case field value in my table that has 81k records (5855 unique case field values).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By comparison, this Python code run on the same dataset takes 1.6 seconds to generate the same information:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, time
myFC = r"C:\my_fgdb.gdb\my_fc"
statDict = {}
statField = "OID@"
caseField = "ELEV"
time1 = time.clock()
searchRows = arcpy.da.SearchCursor(myFC, [statField,caseField])
for searchRow in searchRows:
&amp;nbsp;&amp;nbsp; statValue, caseValue = searchRow
&amp;nbsp;&amp;nbsp; if caseValue in statDict:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; statDict[caseValue].append(statValue)
&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; statDict[caseValue] = [statValue]
sumDict = {}
for caseValue in statDict:
&amp;nbsp;&amp;nbsp; sumDict[caseValue] = len(statDict[caseValue]), max(statDict[caseValue])
time2 = time.clock()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In addition, the ESRI Summary Statistics tool (and ther Frequency tool) give incorrect results in the output table when the case field values are either NULL or 0. Which was a bug that got fixed a long time ago, but seems to be back (at least in v10.1 SP1). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As a solution to little issues like this, I too have a little collection of Python-based code/tools I have written over the years that are either bug work arounds or major performace enhancments for some of the out of the box geoprocessing tools.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:40:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384198#M30267</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T17:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384199#M30268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; In addition, the ESRI Summary Statistics tool (and ther Frequency tool) give incorrect results in the output table when the case field values are either NULL or 0. Which was a bug that got fixed a long time ago, but seems to be back (at least in v10.1 SP1). &lt;BR /&gt;&lt;BR /&gt;As a solution to little issues like this, I too have a little collection of Python-based code/tools I have written over the years that are either bug work arounds or major performace enhancments for some of the out of the box geoprocessing tools.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Based on your solution, what can I do to fix my code as the times are way too high given what you have found?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 21:46:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384199#M30268</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2013-10-30T21:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384200#M30269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So per your original post where I assume you had some data like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ORIG_ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aaa &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aaa&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;bbb&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ccc&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ccc&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aaa&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ddd&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And you want it to come out as this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ORIG_ID SEQ_ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aaa 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aaa 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;bbb 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ccc 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ccc 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aaa 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ddd 4&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code should work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;myFC = r"C:\my_fgdb.gdb\my_fc"
valueSet = set([r[0] for r in arcpy.da.SearchRows(myFC, ["ORIG_ID"])])
valueList = list(valueSet)
valueList.sort()
arcpy.AddField_managment(myFC, "SEQ_ID", "LONG")
updateRows = arcpy.da.UpdateCursor(myFC, ["ORIG_ID","SEQ_ID"])
for updateRow in updateRows:
&amp;nbsp;&amp;nbsp; updateRow[1] = valueList.index(updateRow[0]) + 1
&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow)
del updateRow, updateRows&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:40:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384200#M30269</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T17:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384201#M30270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay, sorry missed the part about you wanting a COUNT field as well... So how about something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, collections
myFC = r"C:\my_fgdb.gdb\my_fc"
valueList = [r[0] for r in arcpy.da.SearchRows(myFC, ["ORIG_ID"])]
valueDict = collections.Counter(valueList)
uniqueList = valueDict.keys()
uniqueList.sort() #if you want SEQ_ID to be sorted numeric or alphabetic
arcpy.AddField_managment(myFC, "SEQ_ID", "LONG")
arcpy.AddField_managment(myFC, "COUNT", "LONG")
updateRows = arcpy.da.UpdateCursor(myFC, ["ORIG_ID","SEQ_ID","COUNT"])
for updateRow in updateRows:
&amp;nbsp;&amp;nbsp; updateRow[1] = uniqueList.index(updateRow[0]) + 1
&amp;nbsp;&amp;nbsp; updateRow[2] = valueDict[updateRow[0]]&amp;nbsp; 
&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow)
del updateRow, updateRows&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:40:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384201#M30270</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T17:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384202#M30271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This worked great, Thank you!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 23:27:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384202#M30271</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2013-10-30T23:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Find Identical tool Replacement</title>
      <link>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384203#M30272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I stumbled upon this after looking for a couple days into my favorite Error 999999 when running the Find Identical tool on a very large dataset in ArcGIS Desktop version 10.2 (in a Python script but also tried it through Toolbox). I noticed it was a 'fixed' bug in 10.1 but I'm guessing the datasets I work with are larger than what they tested as a 'large' dataset. Or else the bug is back in 10.2. Anyway, I was able to code the above solution directly into my Python script and it ran WAY faster than the other method (We're talking close to a 14 hour processing time). &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;Thank you so much &lt;/SPAN&gt;&lt;SPAN&gt;for posting this!! It helped me tremendously.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 20:38:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/find-identical-tool-replacement/m-p/384203#M30272</guid>
      <dc:creator>ChristalHigdon</dc:creator>
      <dc:date>2014-05-30T20:38:32Z</dc:date>
    </item>
  </channel>
</rss>

