<?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: Just learning ArcPy for a very familiar process, but I cant get it run, please advise. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1050352#M60868</link>
    <description>&lt;P&gt;Thanks for the suggestion.&amp;nbsp; His process (example 1) of using Joins and Updates worked great.&amp;nbsp; Instead of a traditional Join and Calculate Field process that took about 5 days to run on 900k records, the Join/Update process copied the desired values over in 57 seconds.&amp;nbsp; THANK YOU! Wish I took the time to figure this out two months ago.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Apr 2021 20:45:03 GMT</pubDate>
    <dc:creator>mhouts_ku</dc:creator>
    <dc:date>2021-04-22T20:45:03Z</dc:date>
    <item>
      <title>Just learning ArcPy for a very familiar process, but I cant get it run, please advise.</title>
      <link>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049356#M60847</link>
      <description>&lt;P&gt;I want to join a table (dbf from a zonal stats) to a FC and then calculate the mean from the dbf into a FC field.&amp;nbsp; I can do it manually, but am hoping in Pro and ArcPy its faster than ArcMap and manual method.&amp;nbsp; With over 1 million polygons joined, it takes about a week to calculate.&amp;nbsp; Please review code below and advise what wrong.&amp;nbsp; Just learning by pulling together examples of familiar processes, please speak noobie. THX!&lt;/P&gt;&lt;P&gt;Got the "add field" to work, the subset below is what fails...&lt;/P&gt;&lt;P&gt;# Set local variables&lt;BR /&gt;inFeatures = "f:/GreatPlains_NHF/Join_calc_test/105_45_532.gdb/Hex_subset105_45_532"&lt;BR /&gt;joinTable = "f:/GreatPlains_NHF/Join_calc_test/105_45_532_summary.dbf"&lt;BR /&gt;joinField = "hexagon_id"&lt;BR /&gt;expression = "Mean"&lt;/P&gt;&lt;P&gt;# Join the feature layer to a table&lt;BR /&gt;arcpy.AddJoin_management(inFeatures, joinField, joinTable, joinField)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Calculate field from joined table ("Mean" attribute) to FC table.&lt;BR /&gt;arcpy.CalculateField_management(inFeatures, "mean_HD_ensamble", expression)&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 20:56:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049356#M60847</guid>
      <dc:creator>mhouts_ku</dc:creator>
      <dc:date>2021-04-20T20:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Just learning ArcPy for a very familiar process, but I cant get it run, please advise.</title>
      <link>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049362#M60848</link>
      <description>&lt;P&gt;Not sure what you are wanting to do.&amp;nbsp; A complete error message would be very useful.&lt;/P&gt;&lt;P&gt;And what "mean" are you trying to calculate?&amp;nbsp;&lt;/P&gt;&lt;P&gt;across rows?&lt;/P&gt;&lt;P&gt;down a column?&lt;/P&gt;&lt;P&gt;partitioned by some other attribute?&lt;/P&gt;&lt;P&gt;Details and other notes on the rest of the code would be useful.&amp;nbsp; Also&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;helps with readability and syntax checking.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 21:05:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049362#M60848</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-04-20T21:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Just learning ArcPy for a very familiar process, but I cant get it run, please advise.</title>
      <link>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049363#M60849</link>
      <description>&lt;P&gt;The "Mean" I am calculating is actually the field name from the zonal stats table. Basically use calculate value to copy values from field "Mean" in the joined table to the "mean_HD_ensamble" field in the source FC that the table is joined to.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 21:09:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049363#M60849</guid>
      <dc:creator>mhouts_ku</dc:creator>
      <dc:date>2021-04-20T21:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Just learning ArcPy for a very familiar process, but I cant get it run, please advise.</title>
      <link>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049371#M60850</link>
      <description>&lt;P&gt;Could you describe the join? Are there multiple records in the dbf for each&amp;nbsp;&lt;SPAN&gt;hexagon_id in the feature class? are you calculating the mean of some value for each group of&amp;nbsp;hexagon_id in the dbf?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 21:20:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049371#M60850</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-04-20T21:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Just learning ArcPy for a very familiar process, but I cant get it run, please advise.</title>
      <link>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049372#M60851</link>
      <description>&lt;P&gt;If&amp;nbsp; your destination field is empty and you are going to calculate values over.&amp;nbsp; A quicker way is to save the joined data to a new featureclass.&amp;nbsp; The expression has to be python supported&amp;nbsp;"Mean" isn't correct&amp;nbsp;"!Mean!" would be if it is a field's name&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 21:20:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049372#M60851</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-04-20T21:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Just learning ArcPy for a very familiar process, but I cant get it run, please advise.</title>
      <link>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049374#M60852</link>
      <description>&lt;P&gt;The destination (recieving) field for the calculate is anew field just created in a previous step before the join ("&lt;SPAN&gt;mean_HD_ensamble").&amp;nbsp; There are many other fields present, so I dont want to just save after the join and have the default min/max/mean field names from the zonal stats table...need to move those into a better named column.&amp;nbsp; Thanks,&amp;nbsp; will try put ! around source and destination field names.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 21:28:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049374#M60852</guid>
      <dc:creator>mhouts_ku</dc:creator>
      <dc:date>2021-04-20T21:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Just learning ArcPy for a very familiar process, but I cant get it run, please advise.</title>
      <link>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049376#M60853</link>
      <description>&lt;P&gt;its a one to one relationship.&amp;nbsp; just trying to basically copy values from one filed "mean" to another field "&lt;SPAN&gt;mean_HD_ensamble".&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 21:29:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049376#M60853</guid>
      <dc:creator>mhouts_ku</dc:creator>
      <dc:date>2021-04-20T21:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Just learning ArcPy for a very familiar process, but I cant get it run, please advise.</title>
      <link>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049382#M60854</link>
      <description>&lt;P&gt;Try some of the techniques described by &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3788"&gt;@RichardFairhurst&lt;/a&gt;&amp;nbsp; in&amp;nbsp;&lt;A href="https://community.esri.com/t5/python-blog/turbo-charging-data-manipulation-with-python-cursors-and/ba-p/884079" target="_blank"&gt;Turbo Charging Data Manipulation with Python Curso... - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 21:37:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1049382#M60854</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-04-20T21:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Just learning ArcPy for a very familiar process, but I cant get it run, please advise.</title>
      <link>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1050352#M60868</link>
      <description>&lt;P&gt;Thanks for the suggestion.&amp;nbsp; His process (example 1) of using Joins and Updates worked great.&amp;nbsp; Instead of a traditional Join and Calculate Field process that took about 5 days to run on 900k records, the Join/Update process copied the desired values over in 57 seconds.&amp;nbsp; THANK YOU! Wish I took the time to figure this out two months ago.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 20:45:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1050352#M60868</guid>
      <dc:creator>mhouts_ku</dc:creator>
      <dc:date>2021-04-22T20:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Just learning ArcPy for a very familiar process, but I cant get it run, please advise.</title>
      <link>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1053671#M60985</link>
      <description>&lt;P&gt;Hi, it might be a bit too late, but as a notice. 1mln features, I would not even try to join. It is much simplier to create dictionary in memory. using the attriutbuttes from 'join' feature create dictionnary - key:[values] where key is your unique id, and values can be 1 value, or list of values. Next run update cursor in your main feature, loop through the key field. if that record is in dictionnary, you can use its values (for example if rec[0] in mydico.keys()): rec[1] = mydico[rec[0]] ).&lt;/P&gt;&lt;P&gt;sorry no script, but there are some articules about that in internet.&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 04:37:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-learning-arcpy-for-a-very-familiar-process/m-p/1053671#M60985</guid>
      <dc:creator>Tomasz_Tarchalski</dc:creator>
      <dc:date>2021-05-03T04:37:46Z</dc:date>
    </item>
  </channel>
</rss>

