<?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 Tool Does not Complete - Help in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547360#M42723</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Michael-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the update. I am experimenting with Caleb's script to see if I can get it to work properly. I might do some research on &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the arcpy.AddIndex tool and rework my original script with the Join and Calculate Field tools to see what works best for our environment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Chris and Caleb:&lt;BR /&gt;&lt;BR /&gt;After further research I think I have found out why my script which performs the same action on a much larger dataset runs quickly.&amp;nbsp; I create an index on the field in the table that I am using to join to the feature class before I create the join.&amp;nbsp; I took the model from another person who built the model in modelbuilder and I exported it to a python script where I made some tweaks (That is why I was unaware of the index previously).&lt;BR /&gt;&lt;BR /&gt;As such Chris, you could also add a arcpy.AddIndex_management step to your process in the CIS table which should dramatically speed up your original script (Only if you can not get Caleb's more advanced script to work for you).&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Apr 2013 14:15:43 GMT</pubDate>
    <dc:creator>ModernElectric</dc:creator>
    <dc:date>2013-04-12T14:15:43Z</dc:date>
    <item>
      <title>Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547340#M42703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I need help really bad. I have been looking through all of the Forum posts and and Help sections to try to figure out what is wrong with no luck. Here is what I am doing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have a File Geodatabase (ArcMap 10.0) with a Feature Class (Service Location) which is the physical location of our electric meters. I have multiple fields that I need to update on a nightly basis. This data comes from our CIS system which holds account, customer and meter attribute information. I have a script to runs automatically every night that pulls an Oracle VW through an ODBC connection and brings it into my File Geodatabase as a Geodatabase Table. What I have to do is to update a specific field (Account Number) in the Feature Class with the same field in the table (ACCOUNTNUM)... Just an example. What I want to be able to do is to also have this script run automatically at night. I have around 9500 records in the feature class with about 15 different fields to do this to. The problem I am having is it takes up to 20 to 25 minutes for each field to update so at times - the script can take 8 to 9 hours to complete. From what I understand - this should take only a few minutes.... So what I am doing is not working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I decided to go back to the "Drawing Board" to see if there is something I am missing with writing the code..... I decided to work with (1) field right now to see if I can make it work and get the update time down before I rewrite the rest of the code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what I currently have and it does not seem to be working:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;## Set the necessary product code import logging&amp;nbsp; # Import arcpy module import arcpy from arcpy import env&amp;nbsp;&amp;nbsp; # if run in ArcGIS Desktop, show messages, also print to log def log(method, msg): &amp;nbsp;&amp;nbsp;&amp;nbsp; print msg &amp;nbsp;&amp;nbsp;&amp;nbsp; method(msg)&amp;nbsp; logging.basicConfig( &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; level=logging.INFO, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format='%(asctime)s %(levelname)-s %(message)s', &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datefmt='%a, %d %b %Y %H:%M:%S', &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename='Test_Update.log', &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filemode='w' &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&amp;nbsp; log(logging.info, "Updating Service Locations Feature Class Begins")&amp;nbsp; # Set environment settings env.workspace = "C:\\MEWCo GIS System\\Electric System\\MEWCo_Electric_Model-LOCAL.gdb"&amp;nbsp; # Set Local variables: inFeatures = "SERVICE_LOCATION"&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; # Service Location Feature Class layerName = "SERVICE_LOCATION_LAYER"&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; # Service Location Feature Layer fieldName1 = "SERVICE_ADDRESS" expression1 = "CIS_Account_Data.SERVICE_ADDRESS" joinField = "POLE_NUMBER" joinField2 = "MAPNO" joinTable = "CIS_Account_Data"&amp;nbsp; # Create a Feature Layer from Service_Location Feature Class log(logging.info, "Create Feature Layer for Service Location Feature Class") arcpy.MakeFeatureLayer_management(inFeatures, layerName)&amp;nbsp; # Join the feature layer to a table log(logging.info, "Join Table to Feature Layer Service Location") arcpy.AddJoin_management(layerName, joinField, joinTable, joinField2) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Calculate Field (Member Number) log(logging.info, "Update Member Number Field") arcpy.CalculateField_management(layerName, "SERVICE_LOCATION.MEMBER_NUMBER", '!MEMBERNO!', "PYTHON")&amp;nbsp; log(logging.info, "Complete")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure what is slowing this down. Am I looking at this process the wrong way?? Are there different tools that can be used to complete this mission??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your help&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 14:42:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547340#M42703</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2013-04-10T14:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547341#M42704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I had the same problem with AddJoin + CalculateField efficiency. One solution could be creating indexes on fields you're using in join if you hadn't done this before. If this won't help (sometimes it's not enough) I would suggest using combination of arcpy.sa.SearchCursor and python dictionary to collect right data from table, and then arcpy.da.UpdateCursor to update featureclass fields. It take some time to write, but it's very efficient. If you need some details feel free to ask.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arek&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 14:58:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547341#M42704</guid>
      <dc:creator>ArkadiuszMatoszka</dc:creator>
      <dc:date>2013-04-10T14:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547342#M42705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;I had the same problem with AddJoin + CalculateField efficiency. One solution could be creating indexes on fields you're using in join if you hadn't done this before. If this won't help (sometimes it's not enough) I would suggest using combination of arcpy.sa.SearchCursor and python dictionary to collect right data from table, and then arcpy.da.UpdateCursor to update featureclass fields. It take some time to write, but it's very efficient. If you need some details feel free to ask.&lt;BR /&gt;&lt;BR /&gt;Best Regards.&lt;BR /&gt;Arek&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arek-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the reply. Creating the Feature Layer and doing the Join seems to work just fine without any hold-up or lagging.... This is being done outside of ArcMap outside of an Edit Session... My intention is to have this done automatically at night and the only way I have figured out to do it is to have a Python Script and run a schedule task using the Windows Task Scheduler.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Forgive me - but I am still really new to Python and not sure how to use or write indexes and python dictionaries......I have done some (very little reading on it).....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas???? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 15:06:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547342#M42705</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2013-04-10T15:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547343#M42706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Arek-&lt;BR /&gt;&lt;BR /&gt;Thank you for the reply. Creating the Feature Layer and doing the Join seems to work just fine without any hold-up or lagging.... This is being done outside of ArcMap outside of an Edit Session... My intention is to have this done automatically at night and the only way I have figured out to do it is to have a Python Script and run a schedule task using the Windows Task Scheduler.&lt;BR /&gt;&lt;BR /&gt;Forgive me - but I am still really new to Python and not sure how to use or write indexes and python dictionaries......I have done some (very little reading on it).....&lt;BR /&gt;&lt;BR /&gt;Any ideas???? &lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; Here is an example of some code I use all the time for getting values from one table to another without needing to join them.&amp;nbsp; I wrote this because I was frustrated by the amount of time it took to use the "join and calculate" method.&amp;nbsp; This is a hundred times faster because it uses dictionaries with update cursors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The parameters are just the target table (I called it source_table below), a field with common values in both tables, a list of fields to be updated, the table with the desired values, the join field, then the fields that contain the values.&amp;nbsp; Below is the 10.0 code, I also have another version for 10.1 which is a little faster.&amp;nbsp; Let me know if you want that.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import sys, traceback, arcpy, os from os import path as p&amp;nbsp; def AttributeUpdate(source_table, in_field, update_fields, join_table, join_key, join_values): &amp;nbsp;&amp;nbsp;&amp;nbsp; try: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; """ Updates fields from one table to user defined fields in another table""" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Check input parameters &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not arcpy.Exists(source_table): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print source_table + ' not found!\nPlease verify that full path of table exists' &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit() &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not arcpy.Exists(join_table): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print join_table + ' not found!\nPlease verify that full path of table exists' &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit() &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if in_field not in [f.name for f in arcpy.ListFields(source_table)]: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print in_field + ' not found in ' + p.basename(source_table) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit() &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if join_key not in [f.name for f in arcpy.ListFields(join_table)]: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print join_key + ' not found in ' + p.basename(join_table) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit() &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fld in update_fields: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if fld not in [f.name for f in arcpy.ListFields(source_table)]: &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 fld + ' not found in ' + p.basename(source_table) &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 'Please verify that field names match in ' + p.basename(source_table) &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; sys.exit() &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fldb in join_values: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if fldb not in [f.name for f in arcpy.ListFields(join_table)]: &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 fldb + ' not found in ' + p.basename(join_table) &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 'Please verify that field names match in ' + p.basename(join_table) &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; sys.exit() &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not type(join_values) == list: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; join_values = list(join_values) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not type(update_fields) == list: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; update_fields = list(update_fields)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Make sure there is matching number of join and update fields &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; update_dict = {} &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(update_fields) == len(join_values): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range(len(update_fields)): &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; update_dict[join_values&lt;I&gt;] = update_fields&lt;I&gt; &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; for k,v in update_dict.iteritems(): &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; # Create Dictionary &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; path_dict = {} &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; srows = arcpy.SearchCursor(join_table) &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 srow in srows: &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; keyrow = srow.getValue(join_key) &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; valrow = srow.getValue(k) &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; path_dict[keyrow] = valrow &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;&amp;nbsp; # Update Cursor &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; urows = arcpy.UpdateCursor(source_table) &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 row in urows: &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; upkey = row.getValue(in_field) &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; try: &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 upkey in path_dict: &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; row.setValue(v, path_dict[upkey]) &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; urows.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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except: &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; pass&amp;nbsp; # skip nulls&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 '\'%s\' field in "%s" updated successfully' %(v, p.basename(source_table)) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del row, urows, srow, srows &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; else: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'ERROR:&amp;nbsp; Number of update fields and value fields does not match' &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: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print '\nERROR in AttributeUpdate Function.\nPlease Check input parameters and try again.'&amp;nbsp;&amp;nbsp;&amp;nbsp; if __name__ == '__main__':&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; shp = r'C:\IGIC\Advanced\Functions\DATA\Iowa_Co.shp' &amp;nbsp;&amp;nbsp;&amp;nbsp; dbf = r'C:\IGIC\Advanced\Functions\DATA\Census_2000.dbf'&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; # Attribute Update test &amp;nbsp;&amp;nbsp;&amp;nbsp; up_fields = ['POP2000','Perc_Urb','Perc_Rur'] &amp;nbsp;&amp;nbsp;&amp;nbsp; jn_fields = ['POP2000','PCT_URB_00','PCT_RUR_00'] &amp;nbsp;&amp;nbsp;&amp;nbsp; AttributeUpdate(shp,'FIPS',up_fields,dbf,'FIPS',jn_fields) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I usually just import this function into other scripts.&amp;nbsp; I have called the script MemoryTableTools.&amp;nbsp; Here is an example of how you can do that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import MemoryTableTools&amp;nbsp; shp = r'C:\IGIC\Advanced\Functions\DATA\Iowa_Co.shp' dbf = r'C:\IGIC\Advanced\Functions\DATA\Census_2000.dbf' up_fields = ['POP2000','Perc_Urb','Perc_Rur'] jn_fields = ['POP2000','PCT_URB_00','PCT_RUR_00']&amp;nbsp; MemoryTableTools.AttributeUpdate(shp,'FIPS',up_fields,dbf,'FIPS',jn_fields)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 15:39:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547343#M42706</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-04-10T15:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547344#M42707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So for your case if you save the script as MemoryTableTools.py like I have, this code should work:&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
from MemoryTableTools import *

# Set environment settings
env.workspace = "C:\\MEWCo GIS System\\Electric System\\MEWCo_Electric_Model-LOCAL.gdb"

# Set Local variables:
inFeatures = "SERVICE_LOCATION"&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; 
joinField = "POLE_NUMBER"
joinField2 = "MAPNO"
joinTable = "CIS_Account_Data"
up_fields = ['MEMBER_NUMBER']
jn_fields = ['MEMBERNO']

# Run Attribute Update
AttributeUpdate(inFeatures, 'POLE_NUMBER', up_fields, joinTable,'MAPNO',jn_fields)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Keep in mind that this works on multiple fields at a time if you need to, the above example just works on one field from your first post.&amp;nbsp; Also, be sure to save the script in a path that can be found by python (PYTHONPATH).&amp;nbsp; A directory like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Python27\ArcGIS10.1\Lib&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:41:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547344#M42707</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T23:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547345#M42708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Its going to take me awhile to figure out the dictionaries and all.... This new script you have me - I did exactly as you directed and get an error message: NameError: name 'AttributeUpdate' is not defined&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So for your case if you save the script as MemoryTableTools.py like I have, this code should work:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
from arcpy import env
from MemoryTableTools import *

# Set environment settings
env.workspace = "C:\\MEWCo GIS System\\Electric System\\MEWCo_Electric_Model-LOCAL.gdb"

# Set Local variables:
inFeatures = "SERVICE_LOCATION"&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; 
joinField = "POLE_NUMBER"
joinField2 = "MAPNO"
joinTable = "CIS_Account_Data"
up_fields = ['MEMBER_NUMBER']
jn_fields = ['MEMBERNO']

# Run Attribute Update
AttributeUpdate(inFeatures, 'POLE_NUMBER', up_fields, joinTable,'MAPNO',jn_fields)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Keep in mind that this works on multiple fields at a time if you need to, the above example just works on one field from your first post.&amp;nbsp; Also, be sure to save the script in a path that can be found by python (PYTHONPATH).&amp;nbsp; A directory like this:&lt;BR /&gt;&lt;BR /&gt;C:\Python27\ArcGIS10.1\Lib&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:41:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547345#M42708</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2021-12-11T23:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547346#M42709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hmm, that is strange.&amp;nbsp; Did you save the script as MemoryTableTools.py and put it in your Python folder?&amp;nbsp; I guess you must have since you did not get an import error.&amp;nbsp; Perhaps you could try the namespace then:&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
import MemoryTableTools

# Set environment settings
env.workspace = "C:\\MEWCo GIS System\\Electric System\\MEWCo_Electric_Model-LOCAL.gdb"

# Set Local variables:
inFeatures = "SERVICE_LOCATION"&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; 
joinField = "POLE_NUMBER"
joinField2 = "MAPNO"
joinTable = "CIS_Account_Data"
up_fields = ['MEMBER_NUMBER']
jn_fields = ['MEMBERNO']

# Run Attribute Update
MemoryTableTools.AttributeUpdate(inFeatures, 'POLE_NUMBER', up_fields, joinTable,'MAPNO',jn_fields)

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:41:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547346#M42709</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T23:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547347#M42710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any reason why Chris' original script should take so long to run?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working with a much larger feature class and table performing the same type of join and calculate geoprocess and it completes in 5 minutes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any chance it could be due to field type differences between the join field in the table and the field that is being calculated in the feature class?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 16:19:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547347#M42710</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-04-10T16:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547348#M42711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Went through and did exactly what you said over again with the script you included in the latest E-Mail....And I get this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ImportError: Bad magic number in C:/Python27/ArcGIS10.1/Lib\weakref.pyc&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also - when I open the script in Python IDLE - it says version: Python 2.6.5 - is this a big deal or do I need to upgrade?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hmm, that is strange.&amp;nbsp; Did you save the script as MemoryTableTools.py and put it in your Python folder?&amp;nbsp; I guess you must have since you did not get an import error.&amp;nbsp; Perhaps you could try the namespace then:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
from arcpy import env
import MemoryTableTools

# Set environment settings
env.workspace = "C:\\MEWCo GIS System\\Electric System\\MEWCo_Electric_Model-LOCAL.gdb"

# Set Local variables:
inFeatures = "SERVICE_LOCATION"&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; 
joinField = "POLE_NUMBER"
joinField2 = "MAPNO"
joinTable = "CIS_Account_Data"
up_fields = ['MEMBER_NUMBER']
jn_fields = ['MEMBERNO']

# Run Attribute Update
MemoryTableTools.AttributeUpdate(inFeatures, 'POLE_NUMBER', up_fields, joinTable,'MAPNO',jn_fields)

&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:41:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547348#M42711</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2021-12-11T23:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547349#M42712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Michael-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I went to my Feature Class and Table just to verify. The (2) fields I am using to Join the table to the feature class are the same. Also the (2) fields (Member Number) are both [TEXT] field type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Caleb:&lt;BR /&gt;&lt;BR /&gt;Is there any reason why Chris' original script should take so long to run?&lt;BR /&gt;&lt;BR /&gt;I am working with a much larger feature class and table performing the same type of join and calculate geoprocess and it completes in 5 minutes.&lt;BR /&gt;&lt;BR /&gt;Is there any chance it could be due to field type differences between the join field in the table and the field that is being calculated in the feature class?&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 16:24:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547349#M42712</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2013-04-10T16:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547350#M42713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Caleb:&lt;BR /&gt;&lt;BR /&gt;Is there any reason why Chris' original script should take so long to run?&lt;BR /&gt;&lt;BR /&gt;I am working with a much larger feature class and table performing the same type of join and calculate geoprocess and it completes in 5 minutes.&lt;BR /&gt;&lt;BR /&gt;Is there any chance it could be due to field type differences between the join field in the table and the field that is being calculated in the feature class?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Michael,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure what the issues were.&amp;nbsp; I guess I should have clarified that I was having slow performance on very large data sets and I was running several different field calculations.&amp;nbsp; I just know that the processing time went from about 20 minutes with the join and calculate method down to under 2 minutes with AttributeUpdate() function I posted above.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can do a speed test real quick and post the times for each process.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 16:26:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547350#M42713</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-04-10T16:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547351#M42714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your solution is very elegant compared to the script that Chris wrote and I helped him modify.&amp;nbsp; I cannot speak for Chris, but your script is advanced and might be difficult for a person new to python scripting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It just seems that Chris' script has a minor issue that can be quickly corrected (once its found) as he is working with such a small dataset.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 16:33:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547351#M42714</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-04-10T16:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547352#M42715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb/Michael-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All is correct. What I am doing is simple ArcGIS Python scripting 101.... When it comes to the talk of dictionaries...indexes...etc (Advanced Python scripting) I am lost......&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There has to be an easier way for a rookie python scripter like myself to be able to program a process that takes Field "Member Number" from a file Geodatabase table and copy it to a field in a file geodatabase "member number" after it makes a join. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would it be easier:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Add Join (Table to Feature Class) - using Map Number/MAPNO as the join attribute&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Export to a new Feature Class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Calculate Field(s)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Delete fields that use to be the table&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Rename feature class back to the original name&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is that overkill or would to work???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Caleb:&lt;BR /&gt;&lt;BR /&gt;Your solution is very elegant compared to the script that Chris wrote and I helped him modify.&amp;nbsp; I cannot speak for Chris, but your script is advanced and might be difficult for a person new to python scripting.&lt;BR /&gt;&lt;BR /&gt;It just seems that Chris' script has a minor issue that can be quickly corrected (once its found) as he is working with such a small dataset.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 16:41:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547352#M42715</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2013-04-10T16:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547353#M42716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With your current script without the data dictionary, can you verify that the data type is the same in the original field of the feature class and the source field you are calculating from in the table?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Like I said before, I have a script that works like yours on a much larger dataset and it finishes in less than 5 minutes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 16:54:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547353#M42716</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-04-10T16:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547354#M42717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; I got your process/script to WORK.......It took about 15 seconds for the MEMBER_NUMBER field to update from the CIS_Account_data table.... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now - I know I have alot of work to do since I have about 20 fields in my electric model and about 15 in my water model to have this done too... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What would be my next step so this works for all of my fields&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Customer name:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Feature Class - CUSTOMER_NAME&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table - CUSTNAME&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much!!!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 17:12:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547354#M42717</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2013-04-10T17:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547355#M42718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb and Michael-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; I got it all to work. The script(s) with the dictionaries did EXACTLY what I wanted it to so with almost NO time at all. Now its just going to take me awhile to program the fields into the script and run an overnight test...... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next step - reading up on dictionaries and indexes so I can attempt to understand this large script that Caleb sent me..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you all (Caleb &amp;amp; Michael) very much for all your help and input.. Think my blood pressure will come down now too...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 17:31:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547355#M42718</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2013-04-10T17:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547356#M42719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Most of the thanks goes to Caleb.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although my script runs in a reasonable timeframe, I can use Caleb's code to make my script even better.&amp;nbsp; Thank you very much Caleb.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 17:35:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547356#M42719</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-04-10T17:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547357#M42720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@ Chris:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am glad you were able to get it to work.&amp;nbsp; As for having it do more fields you just need to make a list of fields to updated in table A and a list of the fields from table B that contain the values.&amp;nbsp; However, you must make sure to keep the fields in the correct order for each list. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
list_A = ['field_1', 'field_2', field_3', etc...]&amp;nbsp; # for table A
list_B = ['field_A', 'field_B', field_C', etc...]&amp;nbsp; # for table B
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have never tested this on more than 7 or so fields at a time but I am sure that it will work the same for 20. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I will try to explain the dictionary usage:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Most of my script is error handling, but the main meat of the script that is actually updating the table is this part:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&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; # Create Dictionary
&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; path_dict = {}
&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; srows = arcpy.SearchCursor(join_table)
&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 srow in srows:
&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; keyrow = srow.getValue(join_key)
&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; valrow = srow.getValue(k)
&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; path_dict[keyrow] = valrow
&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; # Update Cursor
&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; urows = arcpy.UpdateCursor(source_table)
&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 row in urows:
&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; upkey = row.getValue(in_field)
&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; try:
&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 upkey in path_dict:
&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; row.setValue(v, path_dict[upkey])
&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; urows.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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&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; pass&amp;nbsp; # skip nulls
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So a dictionary is just made up of pairs consisting of keys and values like this { key : value}.&amp;nbsp; You can look up a value by supplying the key...Values can be any value (even objects and entire lists).&amp;nbsp; The above portion uses a search cursor on table B (with the values) to make a dictionary using each record in the join field (your common field) as a key.&amp;nbsp; The corresponding value will be one of the fields from the "join_fields" parameter.&amp;nbsp; It creates a separate dictionary for each one.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next, an update cursor is used to search through the table and if the value in the join_field in table A is a key in the dictionary, it will update the corresponding "update_field" for that row.&amp;nbsp; I have an exception set up so that it will skip nulls when working through shapefiles.&amp;nbsp; I hope this makes sense.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@ Michael&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had not tested the field calculator in arcpy land since I upgraded to 10.1.&amp;nbsp; However, after a quick test it seems that it runs much more efficiently now than it did in the past.&amp;nbsp; I have since gotten a new computer so maybe that is why it was so slow in the past.&amp;nbsp; I am glad you find this useful.&amp;nbsp; I have another function from the same script that copies fields from one table to another with the same schema so you can avoid the "field mapping" type operation like in the AttributeUpdate().&amp;nbsp; I can post that if anyone is interested.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:41:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547357#M42720</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T23:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547358#M42721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Yes - some of that makes sense (Use of Dictionaries)... I plan on doing some more research to see if I can use this with other &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;things/ideas with my other geodatabases. I work with electric and water utility infrastructures and been trying to develop some scripts/processes so I can integrate other parts of our company to GIS (CIS data, SCADA, TWACs, ETC).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Again..thank you very much.... This is going to cut down ALOT of time in updating my feature classes with tables from our CIS Oracle database&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;@ Chris:&lt;BR /&gt;&lt;BR /&gt;I am glad you were able to get it to work.&amp;nbsp; As for having it do more fields you just need to make a list of fields to updated in table A and a list of the fields from table B that contain the values.&amp;nbsp; However, you must make sure to keep the fields in the correct order for each list. For example:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
list_A = ['field_1', 'field_2', field_3', etc...]&amp;nbsp; # for table A
list_B = ['field_A', 'field_B', field_C', etc...]&amp;nbsp; # for table B
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;I have never tested this on more than 7 or so fields at a time but I am sure that it will work the same for 20. &lt;BR /&gt;&lt;BR /&gt;Now I will try to explain the dictionary usage:&lt;BR /&gt;&lt;BR /&gt;Most of my script is error handling, but the main meat of the script that is actually updating the table is this part:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&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; # Create Dictionary
&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; path_dict = {}
&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; srows = arcpy.SearchCursor(join_table)
&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 srow in srows:
&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; keyrow = srow.getValue(join_key)
&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; valrow = srow.getValue(k)
&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; path_dict[keyrow] = valrow
&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; # Update Cursor
&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; urows = arcpy.UpdateCursor(source_table)
&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 row in urows:
&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; upkey = row.getValue(in_field)
&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; try:
&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 upkey in path_dict:
&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; row.setValue(v, path_dict[upkey])
&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; urows.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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&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; pass&amp;nbsp; # skip nulls
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;So a dictionary is just made up of pairs consisting of keys and values like this { key : value}.&amp;nbsp; You can look up a value by supplying the key...Values can be any value (even objects and entire lists).&amp;nbsp; The above portion uses a search cursor on table B (with the values) to make a dictionary using each record in the join field (your common field) as a key.&amp;nbsp; The corresponding value will be one of the fields from the "join_fields" parameter.&amp;nbsp; It creates a separate dictionary for each one.&lt;BR /&gt;&lt;BR /&gt;Next, an update cursor is used to search through the table and if the value in the join_field in table A is a key in the dictionary, it will update the corresponding "update_field" for that row.&amp;nbsp; I have an exception set up so that it will skip nulls when working through shapefiles.&amp;nbsp; I hope this makes sense.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;@ Michael&lt;BR /&gt;&lt;BR /&gt;I had not tested the field calculator in arcpy land since I upgraded to 10.1.&amp;nbsp; However, after a quick test it seems that it runs much more efficiently now than it did in the past.&amp;nbsp; I have since gotten a new computer so maybe that is why it was so slow in the past.&amp;nbsp; I am glad you find this useful.&amp;nbsp; I have another function from the same script that copies fields from one table to another with the same schema so you can avoid the "field mapping" type operation like in the AttributeUpdate().&amp;nbsp; I can post that if anyone is interested.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:41:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547358#M42721</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2021-12-11T23:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Tool Does not Complete - Help</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547359#M42722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris and Caleb:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After further research I think I have found out why my script which performs the same action on a much larger dataset runs quickly.&amp;nbsp; I create an index on the field in the table that I am using to join to the feature class before I create the join.&amp;nbsp; I took the model from another person who built the model in modelbuilder and I exported it to a python script where I made some tweaks (That is why I was unaware of the index previously).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As such Chris, you could also add a arcpy.AddIndex_management step to your process in the CIS table which should dramatically speed up your original script (Only if you can not get Caleb's more advanced script to work for you).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 15:37:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-tool-does-not-complete-help/m-p/547359#M42722</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-04-11T15:37:48Z</dc:date>
    </item>
  </channel>
</rss>

