<?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: InsertCursor will not work with the Set function in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21385#M1660</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You so Much........it Works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Larry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2018 21:30:57 GMT</pubDate>
    <dc:creator>LarryAdgate</dc:creator>
    <dc:date>2018-03-16T21:30:57Z</dc:date>
    <item>
      <title>InsertCursor will not work with the Set function</title>
      <link>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21378#M1653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;#I would really appreciate some help on this: I need to use the Set function on this script to remove all&lt;BR /&gt;# my duplicates but the InsertCursor refuses to work here. Any Ideas, Thank You- Larry Adgate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;fc1 = "Database Connections\\TaskmasterServer.sde\\sde_gsw.GSW_SDE.CCB_Updates1"&lt;BR /&gt;fc2= "Database Connections\\TaskmasterServer.sde\\sde_gsw.GSW_SDE.CCB_Data\\sde_gsw.GSW_SDE.Master_CCB_Points"&lt;BR /&gt;fc3 = "K:\\808 - TariffMaps\\MyResults\\MyTable.dbf"&lt;/P&gt;&lt;P&gt;set_one = set(r[0] for r in arcpy.da.SearchCursor(fc1,"PREM_ID"))&lt;BR /&gt;set_two = set(r[0] for r in arcpy.da.SearchCursor(fc2,"PREM_ID"))&lt;BR /&gt;print "Items unique to the Primary Field: {}".format(", ".join(sorted(set_one-set_two)))&lt;/P&gt;&lt;P&gt;results = set(set_one-set_two)&lt;BR /&gt;print results&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;cursor = arcpy.da.InsertCursor(fc3, ["result"])&lt;BR /&gt;#Below is my error= TypeError: value #0 - unsupported type: set&lt;BR /&gt;cursor.insertRow([results])&lt;/P&gt;&lt;P&gt;del cursor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 20:07:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21378#M1653</guid>
      <dc:creator>LarryAdgate</dc:creator>
      <dc:date>2018-03-16T20:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: InsertCursor will not work with the Set function</title>
      <link>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21379#M1654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the geodatabase, what data type is the "result" field in for fc3?&amp;nbsp; You can't store Python data structures likes lists, tuples, sets, dictionaries, etc... directly in a record in a geodatabase, so I am trying to understand what data type "result" is since the field is already created.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 20:12:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21379#M1654</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-03-16T20:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: InsertCursor will not work with the Set function</title>
      <link>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21380#M1655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshuba,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My result data structure are numbers in a text field: Ex: 0000256677&lt;/P&gt;&lt;P&gt;My numbers&amp;nbsp;have leading zeros so the field needs to be text&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Larry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 20:30:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21380#M1655</guid>
      <dc:creator>LarryAdgate</dc:creator>
      <dc:date>2018-03-16T20:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: InsertCursor will not work with the Set function</title>
      <link>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21381#M1656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what does one of your sets look like?&amp;nbsp; Something like set(000025667, 000026443, ....)?&amp;nbsp; If so, how do you want that to look in the text field in the geodatabase?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 20:56:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21381#M1656</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-03-16T20:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: InsertCursor will not work with the Set function</title>
      <link>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21382#M1657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A &lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/399164_Text.JPG" style="width: 279px; height: 376px;" /&gt;A Typical set is in a text Field column. called PREM_ID-&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 21:15:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21382#M1657</guid>
      <dc:creator>LarryAdgate</dc:creator>
      <dc:date>2018-03-16T21:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: InsertCursor will not work with the Set function</title>
      <link>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21383#M1658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can cast the result to string before writing the result using something similar as you already did with:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="string token"&gt;", "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sorted&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;set_one&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;set_two&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(this may generate too many characters to be contained in the field), but I don't understand the&amp;nbsp;purpose of what you are trying to do. Every record will have a string representing the list of ID's that are in fc1 but not in fc2. When you have that, what will you do with this result?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 21:15:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21383#M1658</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-03-16T21:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: InsertCursor will not work with the Set function</title>
      <link>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21384#M1659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;cursor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;InsertCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc3&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"result"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; results&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insertRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:52:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21384#M1659</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-10T20:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: InsertCursor will not work with the Set function</title>
      <link>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21385#M1660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You so Much........it Works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Larry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 21:30:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21385#M1660</guid>
      <dc:creator>LarryAdgate</dc:creator>
      <dc:date>2018-03-16T21:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: InsertCursor will not work with the Set function</title>
      <link>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21386#M1661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You inadvertently marked your answer as correct, I unmarked it, please go back and mark the correct response as being the one&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 21:48:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/insertcursor-will-not-work-with-the-set-function/m-p/21386#M1661</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-03-16T21:48:36Z</dc:date>
    </item>
  </channel>
</rss>

