<?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: Update cursor with joined tables work around w/ dictionaries in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757173#M58414</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Related to this post: &lt;A href="http://forums.arcgis.com/threads/58348-Large-Dictionary-Compression"&gt;http://forums.arcgis.com/threads/58348-Large-Dictionary-Compression&lt;/A&gt;, I am having troubles when the dictionaries get too big!&lt;BR /&gt;&lt;BR /&gt;Although it's slower, especially for multiple fields, I am finding the ole' "Join and Calc" method is much more memory efficient.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I can imagine when you get into storing multiple million tuple datasets to memory on a 32-bit process, you're going to have a bad time. When I implemented mine it was only ~50 rows to reference to the main table, which worked out quite well. I have another process with a 1:1 relationship on the 900k row dataset that I use a join and export process to run calculations on. I hope Esri bites the bullet this decade and converts desktop to a 64-bit application. It's not like datasets or file complexity are shrinking.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe as a quick fix develop some more easy to use interfaces between desktop and server to submit large geoprocessing jobs to server post 10.1 which utilizes 64-bit python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/54612-arcpy-is-using-32bit-Python-installation-how-about-64bit"&gt;http://forums.arcgis.com/threads/54612-arcpy-is-using-32bit-Python-installation-how-about-64bit&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 May 2012 18:06:55 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2012-05-29T18:06:55Z</dc:date>
    <item>
      <title>Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757169#M58410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This post could easily be called "How I fell in love with dictionaries"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Drawing the idea from this post &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/52511-Cool-cursor-dictionary-constructor-one-liner" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/52511-Cool-cursor-dictionary-constructor-one-liner&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've come up with a solution to a nagging problem I know I have been having, and I believe some others have as well, of not being able to reliably use an update cursor when dealing with joined tables. I was really happy with my first foray into dictionaries, and I thought I'd share my work around for anyone looking to optimize some tedious processing with joins. My data was ~900k rows of forest stand data in one table, and a strata reference table of ~50 rows to calculate volumes. My previous method of using a permanent &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000065000000" rel="nofollow" target="_blank"&gt;JoinField&lt;/A&gt;&lt;SPAN&gt;, processing, then deleting those fields, took approximately 3.5 hours. Temporary joins never worked for me in the manner I needed. Using dictionaries instead of joins, that time was reduced to under 15 minutes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code goes through any table and creates a list of field names for every field other than OID and the key field you want to reference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the fairly complete code to create the dictionary&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Starting function" &amp;nbsp;&amp;nbsp;&amp;nbsp; # Define and setup variables, tables, key field etc &amp;nbsp;&amp;nbsp;&amp;nbsp; calc_table = arcpy.MakeTableView_management(table_path) &amp;nbsp;&amp;nbsp;&amp;nbsp; vol_tab = join_table_path &amp;nbsp;&amp;nbsp;&amp;nbsp; strata_tab = "in_memory/temp" &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeTableView_management(vol_tab, strata_tab) &amp;nbsp;&amp;nbsp;&amp;nbsp; joinField = "STRATA" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Create list of value fields, leaving out OID field and key/join field &amp;nbsp;&amp;nbsp;&amp;nbsp; flistObj = arcpy.ListFields(strata_tab) &amp;nbsp;&amp;nbsp;&amp;nbsp; flist = [] &amp;nbsp;&amp;nbsp;&amp;nbsp; for f in flistObj: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if f.type != "OID" and f.name != joinField: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flist.append(f.name)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Create empty dict object then populate each key with a sub dict by row using value fields as keys &amp;nbsp;&amp;nbsp;&amp;nbsp; strataDict = {}&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for r in arcpy.SearchCursor(strata_tab): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldvaldict = {} &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for field in flist: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldvaldict[field] = r.getValue(field) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strataDict[r.getValue(joinField)] = fieldvaldict&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; del strata_tab, flistObj&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the update cursor you can then either explicitly reference dictionary objects like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.UpdateCursor(calc_table, "\"%s\" IS NOT NULL" % joinField) &amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strata = row.getValue(joinField) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; variable = strataDict[strata]["sub_key_field"]&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I did was use a reference list to reference the dictionary to keep things legible, and so I could remember what went where. This may not even be necessary for some people, but it helped me conceptually. Without getting in to too much detail, here's essentially my update cursor sans the actual calculations.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; species = [ &amp;nbsp;&amp;nbsp;&amp;nbsp; ("C","Fb","FB_STEMS"),("C","Sw","SW_STEMS"),("C","Pj","PJ_STEMS"), # 0,1,2 &amp;nbsp;&amp;nbsp;&amp;nbsp; ("C","Pl","PJ_STEMS"),("C","Lt","LT_STEMS"),("C","Sb","SB_STEMS"), # 3,4,5 &amp;nbsp;&amp;nbsp;&amp;nbsp; ("D","Bw","BW_STEMS"),("D","Aw","AW_STEMS"),("D","Pb","PB_STEMS")&amp;nbsp; # 6,7,8 &amp;nbsp;&amp;nbsp;&amp;nbsp; ] &amp;nbsp;&amp;nbsp;&amp;nbsp; sp_fields = [("SP1","SP1_PER"),("SP2","SP2_PER"),("SP3","SP3_PER"), &amp;nbsp;&amp;nbsp;&amp;nbsp; ("SP4","SP4_PER"),("SP5","SP5_PER")] &amp;nbsp;&amp;nbsp;&amp;nbsp; print "Beginning updates" &amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.UpdateCursor(calc_table, "\"%s\" IS NOT NULL" % joinField) &amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strata = row.getValue(joinField) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for sp, per in sp_fields: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sp_type = row.getValue(sp) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spp_f = float(row.getValue(per)) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if spp_f &amp;gt; 0: &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; for grp, spec, stem in species: &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; stem_f = strataDict[strata][stem] &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; (...)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully that didn't get too convoluted, anyone else have anything that might contribute in terms of optimization?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 16:24:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757169#M58410</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-04-12T16:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757170#M58411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using dictionaries to update tables instead of a join more as well. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried refactoring my clumsy lines to use the oneline list comprehension but it turned out to be marginally slower. &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;222565 dictionary count 0:00:46.594000
222565 dictionary count 0:00:48.125000&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I note that you do not bother to specify a subset of fields when opening the cursor. If you have a lot of fields it apparently helps a lot to only list the relevant fields for the calculations. Not so easy to generalise I suppose, but it may help with memory management too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone done some tests on the 10.1 da module that has&amp;nbsp; rewritten cursors? Maybe we will not need dictionaries after all.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:06:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757170#M58411</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2021-12-12T08:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757171#M58412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for this!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;had lots of troubles with processing/updating joined tables, took ages within arcmap/didn´t work at all with updatecursors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;with your suggested dictionaries-route i´ve managed to get it working and really sped things up.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 14:50:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757171#M58412</guid>
      <dc:creator>RaphaelR</dc:creator>
      <dc:date>2012-05-29T14:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757172#M58413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Related to this post: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/58348-Large-Dictionary-Compression"&gt;http://forums.arcgis.com/threads/58348-Large-Dictionary-Compression&lt;/A&gt;&lt;SPAN&gt;, I am having troubles when the dictionaries get too big!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although it's slower, especially for multiple fields, I am finding the ole' "Join and Calc" method is much more memory efficient.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 16:19:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757172#M58413</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-05-29T16:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757173#M58414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Related to this post: &lt;A href="http://forums.arcgis.com/threads/58348-Large-Dictionary-Compression"&gt;http://forums.arcgis.com/threads/58348-Large-Dictionary-Compression&lt;/A&gt;, I am having troubles when the dictionaries get too big!&lt;BR /&gt;&lt;BR /&gt;Although it's slower, especially for multiple fields, I am finding the ole' "Join and Calc" method is much more memory efficient.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I can imagine when you get into storing multiple million tuple datasets to memory on a 32-bit process, you're going to have a bad time. When I implemented mine it was only ~50 rows to reference to the main table, which worked out quite well. I have another process with a 1:1 relationship on the 900k row dataset that I use a join and export process to run calculations on. I hope Esri bites the bullet this decade and converts desktop to a 64-bit application. It's not like datasets or file complexity are shrinking.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe as a quick fix develop some more easy to use interfaces between desktop and server to submit large geoprocessing jobs to server post 10.1 which utilizes 64-bit python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/54612-arcpy-is-using-32bit-Python-installation-how-about-64bit"&gt;http://forums.arcgis.com/threads/54612-arcpy-is-using-32bit-Python-installation-how-about-64bit&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 18:06:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757173#M58414</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-05-29T18:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757174#M58415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's funny I'm reading this post today.....I just switched one of my scripts from a join and select method to a dictionary method and processing time went down from 2 hours to 8 minutes.&amp;nbsp; Long live the dictionary!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2012 18:41:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757174#M58415</guid>
      <dc:creator>BruceBacia</dc:creator>
      <dc:date>2012-06-01T18:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757175#M58416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's a neat, pythonesque way of removing unwanted field names.&amp;nbsp; Not sure if it will be faster, but it looks cooler!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;flistObj = arcpy.Listfields(strata_tab)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;flist = [f.name for f in flistObj]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for exclude in ['OID','joinField']:[INDENT]flist.remove(exclude)[/INDENT]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2012 18:55:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757175#M58416</guid>
      <dc:creator>BruceBacia</dc:creator>
      <dc:date>2012-06-01T18:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757176#M58417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think this will work, too...even shorter&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;flistObj = arcpy.Listfields(strata_tab)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;exclude = ['OID','joinField']&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;flist = [f.name for f in flistObj if f.name not in exclude]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2012 19:03:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757176#M58417</guid>
      <dc:creator>BruceBacia</dc:creator>
      <dc:date>2012-06-01T19:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757177#M58418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Mathew&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I came across your thread and hope that you are able to assist me to use python dictionaries to accomplish what I'm trying to do. Please note that I'm new to Python and would need some assistance to understand your code if you don't mind and have the time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 7.5 million parcles saved as a feature class. Within the feature class I have a field called "&lt;/SPAN&gt;&lt;STRONG&gt;SG_Code&lt;/STRONG&gt;&lt;SPAN&gt;". I also have two tables called WARMS (i.e. WARMS_DW760 &amp;amp; WARMS DW764). They each have a field called "&lt;/SPAN&gt;&lt;STRONG&gt;SG_Code&lt;/STRONG&gt;&lt;SPAN&gt;" &amp;amp; "&lt;/SPAN&gt;&lt;STRONG&gt;TIT_DEED_NUM&lt;/STRONG&gt;&lt;SPAN&gt;". I then have another two additional tables called RED (i.e. Redistribution) and REST (i.e. Restitution). The RED and REST tables have a two fields "&lt;/SPAN&gt;&lt;STRONG&gt;SG_CODE&lt;/STRONG&gt;&lt;SPAN&gt;" and "&lt;/SPAN&gt;&lt;STRONG&gt;TIT_DEED_NUM&lt;/STRONG&gt;&lt;SPAN&gt;".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to create a subset feature class of the 7.5 million parcles where I find a match using firstly the "&lt;/SPAN&gt;&lt;STRONG&gt;SG_Code&lt;/STRONG&gt;&lt;SPAN&gt;" between the parcles feature class and each WARMS table separately (i.e. WARMS_DW760 then WARMS_DW764). I then need to find a match using the original 7.5 million feature class and RED and REST tables using the "&lt;/SPAN&gt;&lt;STRONG&gt;SG_Code&lt;/STRONG&gt;&lt;SPAN&gt;". Then I need to find a match based on the match already found using the 7.5 million records between the WARMS_DW760 and WARMS_DW764 and then match the "&lt;/SPAN&gt;&lt;STRONG&gt;TIT_DEED_NUM&lt;/STRONG&gt;&lt;SPAN&gt;" and the "&lt;/SPAN&gt;&lt;STRONG&gt;TIT_DEED_NUM&lt;/STRONG&gt;&lt;SPAN&gt;" found in the RED and REST tables to see if I find additional matches using the "&lt;/SPAN&gt;&lt;STRONG&gt;TIT_DEED_NUM&lt;/STRONG&gt;&lt;SPAN&gt;" as not all the records have "&lt;/SPAN&gt;&lt;STRONG&gt;SG_Codes&lt;/STRONG&gt;&lt;SPAN&gt;" within the REST and RED tables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In short, what I'm trying to accomplish is to identify where I find a match between the parcles and warms, then a match between the parcles and RED and REST.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've used &lt;/SPAN&gt;&lt;STRONG&gt;Add Joins&lt;/STRONG&gt;&lt;SPAN&gt; so far to accomplish this, but its running forever. I've attached my model that I've built so far to better understand what I'm trying to accomplish.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 16:11:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757177#M58418</guid>
      <dc:creator>PeterWilson</dc:creator>
      <dc:date>2012-10-05T16:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757178#M58419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Peter - The basic method is shown here: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/9555-Modifying-Permanent-Sort-script-by-Chris-Snyder?p=30010&amp;amp;viewfull=1#post30010"&gt;http://forums.arcgis.com/threads/9555-Modifying-Permanent-Sort-script-by-Chris-Snyder?p=30010&amp;amp;viewfull=1#post30010&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Oct 2012 14:40:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757178#M58419</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-10-06T14:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757180#M58421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is never true so you are not stepping into the update line. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;if&amp;nbsp; eZoneNameString == [snName]:&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also think you may be confusing lists and dictionaries.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 15:13:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757180#M58421</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2014-04-02T15:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757181#M58422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;This is how I've implemented the new DA cursors. The cursor is limited to the fields you want to update with the join field located at index 0, the dictionary is created with row[0] as the key and easily accessed by the update cursor.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;#Define fields to update, and the field to use as join field&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Fields = ['Direction', 'Cost', 'year', 'Color']&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Key = "UniqueID"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Fields.insert(0, Key)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;#Create Dictionaries ; The dictionaries store the values from the update table in memory&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;x = len(Fields)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;UpdateDict = {}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;#Iterates through all values in the table and stores them in the update dictionary&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;#Dictionary format; Join Field value : list of field values&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;with arcpy.da.SearchCursor(Table, Fields) as cursor:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FieldValDict = {}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for y in range(1,x):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FieldValDict&lt;Y&gt; = row&lt;Y&gt;&lt;/Y&gt;&lt;/Y&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UpdateDict[row[0]] = FieldValDict&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;#Updates the FC from the Update Dictionary&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;#Uses the Join Field value to look up update values&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;with arcpy.da.UpdateCursor(Input, Fields) as cursor:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for y in range(1,x):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;Y&gt; = UpdateDict[row[0]]&lt;Y&gt;&lt;/Y&gt;&lt;/Y&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 17:34:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757181#M58422</guid>
      <dc:creator>TylerLauzen1</dc:creator>
      <dc:date>2014-07-16T17:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757182#M58423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;You could replace:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14057301931133504 jive_text_macro" jivemacro_uid="_14057301931133504"&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FieldValDict = {}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for y in range(1,x):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FieldValDict&lt;Y&gt; = row&lt;Y&gt;&lt;/Y&gt;&lt;/Y&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P style="text-align: left;"&gt;With:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14057302026226002" jivemacro_uid="_14057302026226002" modifiedtitle="true"&gt;
&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FieldValDict = &lt;/SPAN&gt;dict(zip(fields[1:], row[1:]))&lt;/P&gt;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Jul 2014 00:36:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757182#M58423</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2014-07-19T00:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757183#M58424</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;A href="https://github.com/NERC-CEH/arcapi"&gt;Arcapi&lt;/A&gt; has these kind of functions for joining tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;join_using_dict&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/NERC-CEH/arcapi/blob/master/arcapi.py/#L2052-2153" title="https://github.com/NERC-CEH/arcapi/blob/master/arcapi.py/#L2052-2153"&gt;https://github.com/NERC-CEH/arcapi/blob/master/arcapi.py/#L2052-2153&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update_col_from_dict&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/NERC-CEH/arcapi/blob/master/arcapi.py/#L1207-1272" title="https://github.com/NERC-CEH/arcapi/blob/master/arcapi.py/#L1207-1272"&gt;https://github.com/NERC-CEH/arcapi/blob/master/arcapi.py/#L1207-1272&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In many cases it is much faster than the Join Tool.&lt;/P&gt;&lt;P&gt;Filip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Jul 2014 19:41:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757183#M58424</guid>
      <dc:creator>FilipKrál</dc:creator>
      <dc:date>2014-07-20T19:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor with joined tables work around w/ dictionaries</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757179#M58420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm creating a dictionary from featureclasses - emassDict = &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{u'1': [2009621.0, 2009622.0, 2009624.0, 2009623.0, 2009625.0, 2009626.0, 2009627.0]}{u'2': [2009633.0]}{u'3': [2009632.0, 2009631.0, 2009630.0, 2009629.0, 2009628.0]}{u'4': [2009617.0, 2009611.0, 2009610.0, 2009614.0, 2009620.0, 2009612.0, 2009616.0, 2009615.0, 2009613.0, 2009618.0, 2009607.0, 2009605.0, 2009619.0, 2009609.0, 2009606.0, 2009608.0]}{u'5': [2009604.0, 2009601.0, 2009600.0, 2009603.0, 2009602.0]}{u'6': [2009100.0]}{u'7': [2009009.0]}{u'8': [2009004.0, 2009005.0, 2009007.0, 2009008.0, 2009001.0, 2009003.0, 2009002.0, 2009006.0]}{u'9': [2009500.0]}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this same script I want to update one of the fields "iField" with the values from the dictionary - if the key matches the values in another field "eZoneName".&amp;nbsp;&amp;nbsp;&amp;nbsp; The dictionary is being created, but "iField" is not being populated.&amp;nbsp; I'm not receiving any error messages so it has to be in the logic, but I can't see it.&amp;nbsp; Please help, the total script is here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;eZones = r"C:\temp\NLF.gdb\NLF_EM_2009_Dissolve"
eZoneName = str("UniqueID")
iField = "All_EM_List"

eIncidents = r"C:\temp\NLF.gdb\NLF_EM_2009_Identity"
emNameField = ("E_MASS")
joinField = "Dissolve_FID"
arcpy.MakeFeatureLayer_management(eIncidents, "eIncidentsLayer")
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
with arcpy.da.UpdateCursor(eZones, (eZoneName, iField)) as zoneRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for zone in zoneRows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eZoneNameString = zone[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryString = '"' + eZoneName + '" = ' + "'" + eZoneNameString + "'"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(eZones, "CurrenteZonesLayer", queryString)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByLocation_management("eIncidentsLayer", "CONTAINED_BY", "CurrenteZonesLayer")
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; emassDict = dict()
&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 arcpy.SearchCursor("eIncidentsLayer"):
&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; emName = row.getValue(emNameField)
&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; snName = row.getValue(joinField)
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if snName in emassDict:
&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; emassDict[snName].append(emName)
&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; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; emassDict[snName] = [emName]
&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; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print emassDict


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&amp;nbsp; eZoneNameString == [snName]:
&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; zone[1] = [emName]
&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; zoneRows.updateRow(zone)
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; except arcpy.ExecuteError:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(arcpy.GetMessages(0))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; finally:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management("CurrenteZonesLayer")

arcpy.Delete_management("eIncidentsLayer")
del zone, zoneRows&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:06:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-with-joined-tables-work-around-w/m-p/757179#M58420</guid>
      <dc:creator>LisaMay</dc:creator>
      <dc:date>2021-12-12T08:06:35Z</dc:date>
    </item>
  </channel>
</rss>

