<?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: When to use a geoprocessing tool or an update cursor? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318637#M68404</link>
    <description>&lt;P&gt;If I am only working on/updating one field only, I'd consider the calculate field method. If I wanted to use arcade, I'd use calculate field. If there is more than one field needed or I am updating more than one field, or I need to manipulate the data in some way, or the code_block would require python, I'd skip the hassle of trying to get the fields, tabs, and string formatting correctly and just use a cursor. I remember the cursor syntax a lot better too so it usually wins out.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2023 12:24:17 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2023-08-15T12:24:17Z</dc:date>
    <item>
      <title>When to use a geoprocessing tool or an update cursor?</title>
      <link>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318408#M68401</link>
      <description>&lt;P&gt;One of my data processing steps is to apply a function to a field that updates the field contents to standardized values. I can accomplish this using either the Calculate Field tool or use an update cursor. The latter is roughly 5 seconds faster (12 vs 17 seconds) on a table with 142k records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a best practice or rule of thumb when deciding which approach to use? What are the advantages or disadvantages of either case in this situation? I also wonder if the Calculate Field tool is running an update cursor sort of behind the scenes.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 17:19:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318408#M68401</guid>
      <dc:creator>clt_cabq</dc:creator>
      <dc:date>2023-08-14T17:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: When to use a geoprocessing tool or an update cursor?</title>
      <link>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318484#M68402</link>
      <description>&lt;P&gt;Keep it Simple S....&lt;/P&gt;&lt;P&gt;is the guiding principle, use&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm" target="_blank"&gt;Calculate Field (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;the tool goes to arcobjects as does the update cursor&lt;/P&gt;&lt;P&gt;(code can be followed in the following paths&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;C:\....install folder ...\Resources\ArcToolBox\toolboxes&lt;/LI&gt;&lt;LI&gt;C:\....install folder ...\Resources\ArcToolBox\Scripts&lt;/LI&gt;&lt;LI&gt;C:\....install folder ...\Resources\ArcPy\arcpy&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;A lot of condition checking goes on before the data even goes to a cursor... if you know absolutely that the data meets all the conditions and you will be the only one using the script without providing all the checks... then use a cursor and save you that huge 5 seconds.&amp;nbsp; That 5 seconds would be better spent sipping coffee and not worrying about whether you got everything right.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 20:35:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318484#M68402</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-08-14T20:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: When to use a geoprocessing tool or an update cursor?</title>
      <link>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318505#M68403</link>
      <description>&lt;P&gt;Thanks Dan, my impression was that they are pretty equivalent but wasn't sure if there are other impacts to memory usage and such. And yeah, 5 seconds is nothing, that could just be network activity.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 21:39:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318505#M68403</guid>
      <dc:creator>clt_cabq</dc:creator>
      <dc:date>2023-08-14T21:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: When to use a geoprocessing tool or an update cursor?</title>
      <link>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318637#M68404</link>
      <description>&lt;P&gt;If I am only working on/updating one field only, I'd consider the calculate field method. If I wanted to use arcade, I'd use calculate field. If there is more than one field needed or I am updating more than one field, or I need to manipulate the data in some way, or the code_block would require python, I'd skip the hassle of trying to get the fields, tabs, and string formatting correctly and just use a cursor. I remember the cursor syntax a lot better too so it usually wins out.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 12:24:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318637#M68404</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-08-15T12:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: When to use a geoprocessing tool or an update cursor?</title>
      <link>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318814#M68417</link>
      <description>&lt;P&gt;Thanks, this makes sense to me - in this particular use case I'm updating just one field. I have others though where I manipulate the values of several fields using an update cursor, much easier to do in the latter instance than with the field calculator.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 17:48:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318814#M68417</guid>
      <dc:creator>clt_cabq</dc:creator>
      <dc:date>2023-08-15T17:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: When to use a geoprocessing tool or an update cursor?</title>
      <link>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318945#M68421</link>
      <description>&lt;P&gt;If you're working on versioned data in an enterprise GDB, it's a lot easier to calculate field than do an update cursor.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 22:54:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/when-to-use-a-geoprocessing-tool-or-an-update/m-p/1318945#M68421</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2023-08-15T22:54:43Z</dc:date>
    </item>
  </channel>
</rss>

