<?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: Calculate Field with Python in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-with-python/m-p/1040236#M38940</link>
    <description>&lt;P&gt;I suggest using a cursor instead:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from collections import Counter

layer = # name of layer or path to feature class

with arcpy.da.UpdateCursor(layer, ["NAME", "Field"]) as cur:
    count = Counter(name for name, field in cur)
    cur.reset()
    
    for name, field in cur:
        cur.updateRow([name, 1 if count(name) &amp;gt; 1 else 0])&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 24 Mar 2021 15:53:17 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2021-03-24T15:53:17Z</dc:date>
    <item>
      <title>Calculate Field with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-with-python/m-p/1040107#M38912</link>
      <description>&lt;PRE class="ckeditor_codeblock"&gt;uniqueList = []
def isDuplicate(inValue):
  if inValue in uniqueList:
    return 1
  else:
    uniqueList.append(inValue)
    return 0&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qqqq.JPG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/9266iDB6367E4209CC4F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="qqqq.JPG" alt="qqqq.JPG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 11:22:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-with-python/m-p/1040107#M38912</guid>
      <dc:creator>KalSsin</dc:creator>
      <dc:date>2021-03-24T11:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field with Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-with-python/m-p/1040236#M38940</link>
      <description>&lt;P&gt;I suggest using a cursor instead:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from collections import Counter

layer = # name of layer or path to feature class

with arcpy.da.UpdateCursor(layer, ["NAME", "Field"]) as cur:
    count = Counter(name for name, field in cur)
    cur.reset()
    
    for name, field in cur:
        cur.updateRow([name, 1 if count(name) &amp;gt; 1 else 0])&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Mar 2021 15:53:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-with-python/m-p/1040236#M38940</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-03-24T15:53:17Z</dc:date>
    </item>
  </channel>
</rss>

