<?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 Multiple fields at once in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072944#M61501</link>
    <description>Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3374"&gt;@JoeBorgione&lt;/a&gt; - just a digression about "fat" tables with many fields - with shapefiles and (gasp) coverages, empty string fields take up a lot of space and slow things down, as the physical space (eg a 255 byte string field) is used whether there are data in the field or not. However, in the world of geodatabases (which live in highly indexed data structures behind the scenes) empty fields and short string fields do not actually take up space. Also shapefiles don't store null, just ' ' or 0 for string fields.&lt;BR /&gt;Back in the day (1980s, 1990s) we would make tables as skinny as possible by normalizing data (lookup tables) and joins to speed things up - not so much a concern with geodatabases. In geodatabase design you are often better off with fewer, indexed, "fat" tables to keep schemae as simple as possible.&lt;BR /&gt;</description>
    <pubDate>Sat, 26 Jun 2021 15:51:40 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2021-06-26T15:51:40Z</dc:date>
    <item>
      <title>Update Multiple fields at once</title>
      <link>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072837#M61496</link>
      <description>&lt;P&gt;I trying to figure out a better/simpler way of clear multiple fields(meaning making the attributes in fields " ") at once but not all, just specific fields.&lt;/P&gt;&lt;P&gt;I can do it with field calculator but that means i would have about 70 field calculators in the scrip.&lt;/P&gt;&lt;P&gt;How else can this be done, examples?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 22:05:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072837#M61496</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-06-25T22:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update Multiple fields at once</title>
      <link>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072845#M61497</link>
      <description>&lt;P&gt;Check out the new &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-fields.htm" target="_self"&gt;Calclulate Fields&lt;/A&gt; tool introduced in ArcGIS Pro.&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;You could still use &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm" target="_self"&gt;Calculate Field&lt;/A&gt;, just put it in a loop of field names.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 22:55:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072845#M61497</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-06-25T22:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Update Multiple fields at once</title>
      <link>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072846#M61498</link>
      <description>&lt;P&gt;This can be done in Python (either script, command line, Notebook, or using the Calculate Value tool in Model Builder), &amp;nbsp;with the arcpy.da.UpdateCursor method&lt;/P&gt;&lt;P&gt;The Calculate Field tool can only update one field at a time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.da.UpdateCursor(tbl, ["FLD1", "FLD2"]) as rows:
    for row in rows:
        row = (" ", " ") # or (None, None) (None and blank are not the same)
        rows.updateRow()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 22:57:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072846#M61498</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-06-25T22:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Update Multiple fields at once</title>
      <link>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072938#M61500</link>
      <description>&lt;P&gt;I’m with&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1325"&gt;@curtvprice&lt;/a&gt;&amp;nbsp;for using an update cursor.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A couple thoughts to add though; a table with 70 empty fields seems like a boat anchor to me. What value do empty fields bring over deleting them altogether? &amp;nbsp;I also suggest using &amp;nbsp;&amp;lt;Null&amp;gt; value over ‘’ if you must keep them.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jun 2021 13:31:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072938#M61500</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-06-26T13:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Update Multiple fields at once</title>
      <link>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072944#M61501</link>
      <description>Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3374"&gt;@JoeBorgione&lt;/a&gt; - just a digression about "fat" tables with many fields - with shapefiles and (gasp) coverages, empty string fields take up a lot of space and slow things down, as the physical space (eg a 255 byte string field) is used whether there are data in the field or not. However, in the world of geodatabases (which live in highly indexed data structures behind the scenes) empty fields and short string fields do not actually take up space. Also shapefiles don't store null, just ' ' or 0 for string fields.&lt;BR /&gt;Back in the day (1980s, 1990s) we would make tables as skinny as possible by normalizing data (lookup tables) and joins to speed things up - not so much a concern with geodatabases. In geodatabase design you are often better off with fewer, indexed, "fat" tables to keep schemae as simple as possible.&lt;BR /&gt;</description>
      <pubDate>Sat, 26 Jun 2021 15:51:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072944#M61501</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-06-26T15:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Update Multiple fields at once</title>
      <link>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072945#M61502</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1325"&gt;@curtvprice&lt;/a&gt;&amp;nbsp; Excellent points. I’ve been working on a couple large data migrations lately from some old databases (Oracle 7) and have encountered whole tables where multiple complete fields are empty. I just don’t see the value in bringing those fields over to a new and modern database (EGDB / SQL server back end). Call me old fashioned and admittedly I am but Null values will always be my preference over empty’. &amp;nbsp;Then again:&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jun 2021 16:12:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1072945#M61502</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-06-26T16:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Update Multiple fields at once</title>
      <link>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1073240#M61505</link>
      <description>&lt;P&gt;Another option would be to copy the feature class to scratch or memory workspace with only the fields you want to keep their values, truncate the original table, then append back the records and values to keep; everything else will be nulled out.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 16:01:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1073240#M61505</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-06-28T16:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Update Multiple fields at once</title>
      <link>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1073241#M61506</link>
      <description>&lt;P&gt;How would I pass the certain fields and query ( "IS NOT NULL") to use arcpy.CalculatorField?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 16:02:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1073241#M61506</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-06-28T16:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update Multiple fields at once</title>
      <link>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1073255#M61508</link>
      <description>&lt;P&gt;Is there some new requirement that you only need to null out fields that are not null? It's okay if CalculateField nulls an already null field value; you don't need to query them out. If you want to do a query first, either use&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/select-layer-by-attribute.htm" target="_self"&gt;Select Layer By Attribute&lt;/A&gt;&amp;nbsp;first or (what I would recommend) is using the UpdateCursor method mentioned by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1325"&gt;@curtvprice&lt;/a&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 16:17:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-multiple-fields-at-once/m-p/1073255#M61508</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-06-28T16:17:22Z</dc:date>
    </item>
  </channel>
</rss>

