<?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 Help (Python and/or SQL): ArcGIS Pro in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42675#M1771</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would this work for your purposes Chad? Just replace with your field name NRCS_Score or whatever in place of what I have specified for my field CENTERLINEID. This will write Zero to all NULL values:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="474824" alt="Field Calc Null" class="jive-emoji image-1 jive-image" height="855" src="https://community.esri.com/legacyfs/online/474824_fieldcalc.PNG" width="310" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Result of CENTERLINEID field from &amp;lt;NULL&amp;gt; to 0:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG __jive_id="474826" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/474826_pastedImage_1.png" /&gt;&amp;nbsp;&amp;gt;&lt;/STRONG&gt;&lt;IMG __jive_id="474825" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/474825_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;EDIT: &lt;SPAN style="text-decoration: underline;"&gt;Here is the code using your NRCS_Score field as example&lt;/SPAN&gt;:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NRCS_Score&amp;nbsp;=&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;updateValue(!NRCS_Score!)&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Code Block&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;updateValue&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;value&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; value &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'0'&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; value‍‍‍‍&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:38:29 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-10T21:38:29Z</dc:date>
    <item>
      <title>Calculate Field Help (Python and/or SQL): ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42671#M1767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #292f34; background-color: #ffffff; font-size: 14px;"&gt;So I have several field in an attribute table that have &amp;lt;Null&amp;gt; value, I am wanting to using the 'Calculate Field' GP tool to select the &amp;lt;Null&amp;gt; values and replace them with zero. Anyone have any ideas on the Python and/or SQL statement I would use to execute this?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2019 14:26:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42671#M1767</guid>
      <dc:creator>Lebowski</dc:creator>
      <dc:date>2019-11-26T14:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Help (Python and/or SQL): ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42672#M1768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The sql statement you'll use in the selection :&lt;/P&gt;&lt;P&gt;&amp;lt;YourField&amp;gt; is null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/474645_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your field calculator will then look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/474646_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2019 14:59:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42672#M1768</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-11-26T14:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Help (Python and/or SQL): ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42673#M1769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to do all of this in one step either using the 'Calculate Field' GP in Pro or even better the 'Calculate Fields' GP tool in Pro. Any idea how that would look?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2019 15:01:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42673#M1769</guid>
      <dc:creator>Lebowski</dc:creator>
      <dc:date>2019-11-26T15:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Help (Python and/or SQL): ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42674#M1770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the tools?&amp;nbsp; No.&amp;nbsp; Using a python script, absolutely.&amp;nbsp; What's your preference?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2019 15:19:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42674#M1770</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-11-26T15:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Help (Python and/or SQL): ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42675#M1771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would this work for your purposes Chad? Just replace with your field name NRCS_Score or whatever in place of what I have specified for my field CENTERLINEID. This will write Zero to all NULL values:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="474824" alt="Field Calc Null" class="jive-emoji image-1 jive-image" height="855" src="https://community.esri.com/legacyfs/online/474824_fieldcalc.PNG" width="310" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Result of CENTERLINEID field from &amp;lt;NULL&amp;gt; to 0:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG __jive_id="474826" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/474826_pastedImage_1.png" /&gt;&amp;nbsp;&amp;gt;&lt;/STRONG&gt;&lt;IMG __jive_id="474825" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/474825_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;EDIT: &lt;SPAN style="text-decoration: underline;"&gt;Here is the code using your NRCS_Score field as example&lt;/SPAN&gt;:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NRCS_Score&amp;nbsp;=&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;updateValue(!NRCS_Score!)&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Code Block&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;updateValue&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;value&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; value &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
   &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'0'&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; value‍‍‍‍&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:38:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42675#M1771</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-10T21:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Help (Python and/or SQL): ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42676#M1772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://legacy.python.org/dev/peps/pep-0008/#programming-recommendations" title="https://legacy.python.org/dev/peps/pep-0008/#programming-recommendations"&gt;PEP 8 -- Style Guide for Python Code&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; foo &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;'is' is preferred to '==' as a general recommendation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Nov 2019 18:12:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42676#M1772</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-11-27T18:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field Help (Python and/or SQL): ArcGIS Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42677#M1773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following field calculator Python expression (no Code Block necessary) should work for you:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; !field! &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; None &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; !field!&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Nov 2019 16:41:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-help-python-and-or-sql-arcgis-pro/m-p/42677#M1773</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-11-28T16:41:09Z</dc:date>
    </item>
  </channel>
</rss>

