<?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: Arcpy - search duplicate attributes, then update values in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534287#M41847</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Geoff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I’ll have a play around with this approach!&lt;/P&gt;&lt;P&gt;Yeah I was hoping to loop through the data and create a “list” of ID+Owner for the dataset.&lt;/P&gt;&lt;P&gt;Then update a new field using this data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Feb 2015 01:28:30 GMT</pubDate>
    <dc:creator>timdunlevie</dc:creator>
    <dc:date>2015-02-02T01:28:30Z</dc:date>
    <item>
      <title>Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534281#M41841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone point me in the right direction.&lt;/P&gt;&lt;P&gt;I have limited python scripting experience but know a enough (to be dangerous).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I want to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a shapefile which has duplicate objects based on an "ID".&lt;/P&gt;&lt;P&gt;Object1: ID1 + Owner1&lt;/P&gt;&lt;P&gt;Object2: ID1 + Owner2&lt;/P&gt;&lt;P&gt;Object3: ID1 + Owner3&lt;/P&gt;&lt;P&gt;in this example there are 3 objects with identical ID but with 3 different owners for the same object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to do is search through the shapefiles for all identical "ID", then update a new shapefile with :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Object1: ID1 + Owner1 + Owner2 + Owner3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The new shapefile would have 3 extra columns added for the Owner field to be updated to.&lt;/P&gt;&lt;P&gt;so I want 1 object only but keep the owner information in the row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 04:10:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534281#M41841</guid>
      <dc:creator>timdunlevie</dc:creator>
      <dc:date>2015-01-30T04:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534282#M41842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you had a look at the find identical tool&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000054000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000054000000"&gt;ArcGIS Help 10.1&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would run the tool to find features that have duplicates and then with the created table use this to help populate your new shape file&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 08:55:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534282#M41842</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2015-01-30T08:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534283#M41843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So what would happen if the same ID had five different owners? Or ten different owners? You'll just have to keep increasing the number of columns to accommodate the most duplicated ID. Sounds like these are not duplicates but rather you have two key fields. I wouldn't try making extra columns for the additional owners because it will get messy. Is there some kind of dependency requiring you to format your data like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your example, do each of the three objects also have different geometry/location? If the geometry is the same, maybe you could consider using a &lt;A href="http://resources.arcgis.com/en/help/main/10.2/005s/005s0000002v000000.htm"&gt;related table&lt;/A&gt; so you can have one object with one ID related to an owner table that has three records with the same ID and each different owner.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 16:43:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534283#M41843</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2015-01-30T16:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534284#M41844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm in the same boat as you with being a novice with Python scripting.&amp;nbsp; My lastest phase of attribute manipulation has been with using dictionaries to use a one (key) to multiple (value list) data entry.&amp;nbsp; I dont' know how you have your data structured, but using dictionary indices can access the particular values you want.&amp;nbsp; You could probably create a row dictionary and update a dictionary of the dataset to reference for assigning the owners where you want the information to go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rowDict = {rowID : [Owner1, Owner2, Owner3]}&lt;/P&gt;&lt;P&gt;fullDict.update(rowDict)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can pull your owners out again&lt;/P&gt;&lt;P&gt;fullDict.keys().index(rowID)#this returns the index location of the key&lt;/P&gt;&lt;P&gt;fullDict.values()[fullDict.keys().index(rowID)]#this returns the owners for the row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can pull each owner from the returned list about and an additional index&lt;/P&gt;&lt;P&gt;fullDict.values()[fullDict.keys().index(rowID)][1]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rowID = 76
Owner1 = "John"
Owner2 = "Sally"
Owner3 = "George"
rowDict = {rowID : [Owner1, Owner2, Owner3]}
fullDict = dict()
fullDict.update(rowDict)#updates the row of information to the full dictionary

fullDict.keys().index(rowID)#returns the owners' names

&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;fullDict.keys().index(rowID)[1]#returns the owner's name of the second owner in the list&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt; the second owner in the list&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If the owners names are in separate objects, it's possible to update the dictionary to add the other owners names.&amp;nbsp; The only way to do that is with dict.update() and the new dictionary values has to have the same key as what it's overwriting and the values then need to be a list of the owners from all the objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a.update({a.keys()[indexForRow_ID_For_A]:[a.values()[indexForRow_ID_For_A], b.values()[indexForRow_ID_For_B], c.values()[indexForRow_ID_For_C]]})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would take the key value from A and update the values with the values from A, B, and C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like I said, my knowledge of Python is still in the novice section.&amp;nbsp; If I understand what your trying to do, then perhaps dictionaries can help.&amp;nbsp; I hope this helps in some way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:12:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534284#M41844</guid>
      <dc:creator>GeoffOlson</dc:creator>
      <dc:date>2021-12-11T23:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534285#M41845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think Blakes suggestion is best for this kind of data scenario. But if you still want to keep the kind of data structure you have, which is stacked polygons due to multiple owner, I don't get why the need to go through the process of modifying your data. If you are just after a report like info of how many and who are the owners of each polygon based on ID, you just write a script to spit out a csv file which does that summary and leave your data intact. That's just my two cents.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Feb 2015 20:36:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534285#M41845</guid>
      <dc:creator>ChrisPedrezuela</dc:creator>
      <dc:date>2015-02-01T20:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534286#M41846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case Blake, there will only ever be 9 Owners (max).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way I was thinking would be to create a new table with the structure I want.&lt;/P&gt;&lt;P&gt;Loop thru the data to get a list of Unique ID+Owner&lt;/P&gt;&lt;P&gt;Then populate the Owners field in the new table with the list of data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same IDs have identical geometry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 01:26:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534286#M41846</guid>
      <dc:creator>timdunlevie</dc:creator>
      <dc:date>2015-02-02T01:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534287#M41847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Geoff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I’ll have a play around with this approach!&lt;/P&gt;&lt;P&gt;Yeah I was hoping to loop through the data and create a “list” of ID+Owner for the dataset.&lt;/P&gt;&lt;P&gt;Then update a new field using this data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 01:28:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534287#M41847</guid>
      <dc:creator>timdunlevie</dc:creator>
      <dc:date>2015-02-02T01:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534288#M41848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At first you mentioned you want the results in a shapefile but now you're saying you want a "list." If some kind of printed report is really what you're after, you could try this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

inputTable = &lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;r"C:\temp\myworking.gdb\&lt;/SPAN&gt;mytablename"
fields = ["ID","OWNER"]

uniqueID = {}

with arcpy.da.SearchCursor(inputTable, fields) as s_cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in s_cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;# Underscore in front of variable names only because "id" is a Python reserved word&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _id = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _owner = row[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uniqueID.setdefault(_id, []).append(_owner)

for _id, _owners in uniqueID.items():
&amp;nbsp;&amp;nbsp;&amp;nbsp; print _id, _owners&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It uses an &lt;A href="http://resources.arcgis.com/en/help/main/10.2/018w/018w00000011000000.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;arcpy data access search cursor&lt;/A&gt; to read through your data table one row at a time. With each row, it loads the ID and owner into a dictionary (like &lt;A href="https://community.esri.com/migrated-users/36889" target="_blank"&gt;Geoff Olson&lt;/A&gt; mentioned &lt;A _jive_internal="true" href="https://community.esri.com/message/453745#453745" target="_blank"&gt;below&lt;/A&gt;). However, as each row is loaded, the dictionary &lt;A href="http://www.tutorialspoint.com/python/dictionary_setdefault.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;setdefault method&lt;/A&gt; checks to see if that ID has already been loaded. If it has not, it will create a new dictionary key for that ID and an empty list for the dictionary value. The list &lt;A href="http://www.tutorialspoint.com/python/list_append.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;append method&lt;/A&gt; is the one that actually adds the owner to the list. You're left with a dictionary that has keys of only unique IDs and values as a list of owners. It just prints the results to the Python interpreter window. You could also write the data to a CSV or a new feature class or shapefile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/a/18836198" rel="nofollow noopener noreferrer" target="_blank"&gt;Here's the credit&lt;/A&gt; for the logic I used to populate the dictionary.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:12:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534288#M41848</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-12-11T23:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534289#M41849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what I came up with:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="parcelsCleaned.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/58081_parcelsCleaned.png" style="width: 620px; height: 444px;" /&gt;&lt;/P&gt;&lt;P&gt;Upper table is the input featureclass, the lower table is the result (cleaned)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def main():
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy
&amp;nbsp;&amp;nbsp;&amp;nbsp; import os

&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_in = r"D:\Xander\GeoNet\RemoveDuplicates\test.gdb\Parcels"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_out = r"D:\Xander\GeoNet\RemoveDuplicates\test.gdb\Parcels_cleaned"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_id = "ID"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_owner = "OWNER"
&amp;nbsp;&amp;nbsp;&amp;nbsp; sr = arcpy.Describe(fc_in).spatialReference

&amp;nbsp;&amp;nbsp;&amp;nbsp; # create empty output fc
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_ws, fc_name = os.path.split(fc_out)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CreateFeatureclass_management(fc_ws, fc_name, template=fc_in, spatial_reference=sr)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # create dictionary with ID's te keep and related owners
&amp;nbsp;&amp;nbsp;&amp;nbsp; flds = (fld_id, fld_owner)
&amp;nbsp;&amp;nbsp;&amp;nbsp; dct = {}
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(fc_in, flds) as curs_in:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row_in in curs_in:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_id = row_in[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_owner = row_in[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if p_id in dct:
&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;&amp;nbsp;&amp;nbsp; dct[p_id] += ", {0}".format(p_owner)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dct[p_id] = p_owner
&amp;nbsp;&amp;nbsp;&amp;nbsp; del row_in, curs_in

&amp;nbsp;&amp;nbsp;&amp;nbsp; # now do the update:
&amp;nbsp;&amp;nbsp;&amp;nbsp; flds = correctFieldList(arcpy.ListFields(fc_out))
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.InsertCursor(fc_out, flds) as curs_out:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(fc_in, flds) as curs_in:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # flds_in = curs_in.fields
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row_in in curs_in:
&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;&amp;nbsp;&amp;nbsp; lst_row = list(row_in)
&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;&amp;nbsp;&amp;nbsp; p_id = row_in[flds.index(fld_id)]
&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;&amp;nbsp;&amp;nbsp; if p_id in dct:
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; owners = dct[p_id]
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_row[flds.index(fld_owner)] = owners
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print lst_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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # remove from dct
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp = dct.pop(p_id)
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curs_out.insertRow(tuple(lst_row))

def correctFieldList(flds):
&amp;nbsp;&amp;nbsp;&amp;nbsp; flds_use = ['Shape@']
&amp;nbsp;&amp;nbsp;&amp;nbsp; fldtypes_not = ['Geometry', 'Guid', 'OID']
&amp;nbsp;&amp;nbsp;&amp;nbsp; for fld in flds:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not fld.type in fldtypes_not:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flds_use.append(fld.name)
&amp;nbsp;&amp;nbsp;&amp;nbsp; return flds_use

if __name__ == '__main__':
&amp;nbsp;&amp;nbsp;&amp;nbsp; main()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:12:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534289#M41849</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T23:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534290#M41850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;many thanks!&lt;/P&gt;&lt;P&gt;this works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only issue I had was the original shp file "owner" field had a size of 60 characters...&lt;/P&gt;&lt;P&gt;So when the update occurred on the new field (60 characters) it was truncating the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to alter the field sizes of an existing field in arcpy?&lt;/P&gt;&lt;P&gt;or do you have to create a new field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks to all those who replied.&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 04:16:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534290#M41850</guid>
      <dc:creator>timdunlevie</dc:creator>
      <dc:date>2015-02-03T04:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534291#M41851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good question... I don't think so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Alter Field tool that was released not so lng ago only allows you to change the name and alias of an existing field. However, you could delete the field, after the empty output featureclass is created and add the field with the same name, but with a larger length. before you start inserting the information. The downside is that it will change the order of the fields and the way to construct the output row would be a little more complex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 11:45:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534291#M41851</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-03T11:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534292#M41852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't mind the changed order of the fields, you could:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;rename the existing OWNER field using Alter Field (&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000198000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000198000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; ). eg "OWNER_old"&lt;/LI&gt;&lt;LI&gt;next add a new field with the name OWNER with the larger length&lt;/LI&gt;&lt;LI&gt;fill the new OWNER field with the values the "OWNER_old" field (Field Calculator)&lt;/LI&gt;&lt;LI&gt;Delete the "OWNER_old" field&lt;/LI&gt;&lt;LI&gt;then run the script&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 11:47:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534292#M41852</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-03T11:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534293#M41853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could use the feature class to feature class tool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001200000020000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//001200000020000000"&gt;ArcGIS Help 10.1&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the field map parameters right click on your owner field and extend the size. Once created delete your original feature class and rename your new one to the same as your old one&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 15:01:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534293#M41853</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2015-02-03T15:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534294#M41854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the purpose of removing (and returning) the item from the dictionary just before you write it to the shapefile? I don't see the "tmp" variable used anywhere else.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14229762496223309 jive_text_macro" jivemacro_uid="_14229762496223309"&gt;&lt;P&gt;tmp = dct.pop(p_id)&lt;/P&gt;&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 15:10:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534294#M41854</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2015-02-03T15:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534295#M41855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason is, when I ommit this, it wil write the equal amount of features to the output. Removing it from the dictionary will cause the condition on line 36 to return False (and not add an ID that has already been added).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need any additional explanation on the code, just let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Xander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 16:02:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534295#M41855</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-03T16:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534296#M41856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Xander, I see it now. I'm just trying to understand the code and your process.&lt;/P&gt;&lt;P&gt;So you are iterating through the fc_in rows and then checking if the current ID is in the dictionary before writing the data to fc_out. I was thinking it might be easier to iterate through the dictionary instead of fc_in so you wouldn't have to remove the dictionary item but then I don't know how you would find the correct row in fc_in to copy the data in the rest of the fields. Is there a way to do that? Seems like it could be a faster because you wouldn't have to touch every row of in_fc; you're done after checking every item in the dictionary.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 16:25:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534296#M41856</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2015-02-03T16:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534297#M41857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see your point. However, I'm using the da cursors which is rather fast. Using the dictionary as basis, you would have to extract the corresponding feature from fc_in. This would require creating a cursor with probably a where clause on oid to extract the feature you're interested in. I think this would create a script that perfoms slower than what I am doing...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 16:32:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534297#M41857</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-03T16:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534298#M41858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, yes, the where clause when you create the cursor! But then you would have to use a dynamic where clause and create a new cursor each time. I agree with you then, it would be silly to do that compared to just popping the item from the dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the clarification Xander!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 16:38:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534298#M41858</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2015-02-03T16:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534299#M41859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;but you are right, it is possible to fill a dictionary with the features from the first search cursor and use the dictionary during the insert cursor. This might become a problem for large datasets...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 17:05:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534299#M41859</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-03T17:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - search duplicate attributes, then update values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534300#M41860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And this could be the code with a cursor less and an additional dictionary (I think it is a little faster, but I didn't test for speed):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def main():
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy
&amp;nbsp;&amp;nbsp;&amp;nbsp; import os

&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_in = r"D:\Xander\GeoNet\RemoveDuplicates\test.gdb\Parcels"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_out = r"D:\Xander\GeoNet\RemoveDuplicates\test.gdb\Parcels_cleaned"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_id = "ID"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_owner = "OWNER"

&amp;nbsp;&amp;nbsp;&amp;nbsp; sr = arcpy.Describe(fc_in).spatialReference
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_oid = arcpy.Describe(fc_in).OIDFieldName

&amp;nbsp;&amp;nbsp;&amp;nbsp; # create empty output fc
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_ws, fc_name = os.path.split(fc_out)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CreateFeatureclass_management(fc_ws, fc_name, template=fc_in, spatial_reference=sr)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # create dictionary with ID's and related owners and dictionary with rows
&amp;nbsp;&amp;nbsp;&amp;nbsp; flds = correctFieldList(arcpy.ListFields(fc_in))
&amp;nbsp;&amp;nbsp;&amp;nbsp; dct_owner = {}
&amp;nbsp;&amp;nbsp;&amp;nbsp; dct_ids2use = {}
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(fc_in, flds) as curs_in:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row_in in curs_in:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_id = row_in[flds.index(fld_id)]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_owner = row_in[flds.index(fld_owner)]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if p_id in dct_owner:
&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;&amp;nbsp;&amp;nbsp; dct_owner[p_id] += ", {0}".format(p_owner)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dct_owner[p_id] = p_owner
&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;&amp;nbsp;&amp;nbsp; dct_ids2use[p_id] = list(row_in) # just register the first encounter of the id
&amp;nbsp;&amp;nbsp;&amp;nbsp; del row_in, curs_in

&amp;nbsp;&amp;nbsp;&amp;nbsp; # now do the update:
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.InsertCursor(fc_out, flds) as curs_out:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for p_id, lst_row in dct_ids2use.items():
&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;&amp;nbsp;&amp;nbsp; lst_row[flds.index(fld_owner)] = dct_owner[p_id]
&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;&amp;nbsp;&amp;nbsp; curs_out.insertRow(tuple(lst_row))

def correctFieldList(flds):
&amp;nbsp;&amp;nbsp;&amp;nbsp; flds_use = ['Shape@']
&amp;nbsp;&amp;nbsp;&amp;nbsp; fldtypes_not = ['Geometry', 'Guid', 'OID']
&amp;nbsp;&amp;nbsp;&amp;nbsp; for fld in flds:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not fld.type in fldtypes_not:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flds_use.append(fld.name)
&amp;nbsp;&amp;nbsp;&amp;nbsp; return flds_use

if __name__ == '__main__':
&amp;nbsp;&amp;nbsp;&amp;nbsp; main()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:12:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-search-duplicate-attributes-then-update/m-p/534300#M41860</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T23:12:46Z</dc:date>
    </item>
  </channel>
</rss>

