<?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 Reclass null values in text field using Calculate Field in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647294#M28738</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a text field called 'Description' that contains some &amp;lt;Null&amp;gt; values that I wish to update to 'Hedgerows' while keeping all other values the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using&amp;nbsp;Calculate Field in Pro,&amp;nbsp;I tried the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reclass (!Description!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code block&lt;/P&gt;&lt;P&gt;def Reclass(Description):&lt;/P&gt;&lt;P&gt;if (IsNull)&lt;/P&gt;&lt;P&gt;return Hedgerows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression was successfully verified but I then got the following error message when running the tool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error 00539: Error running expression: Reclass (u"Buildings")&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;File "&amp;lt;expression&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;File "&amp;lt;string&amp;gt;, line 2, in Reclass&lt;/P&gt;&lt;P&gt;Name Error: name 'IsNull' is not defined&lt;/P&gt;&lt;P&gt;Failed to execute (CalculateField).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions? I'm a complete novice when it comes to Python.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Dec 2017 12:26:54 GMT</pubDate>
    <dc:creator>DataOfficer</dc:creator>
    <dc:date>2017-12-05T12:26:54Z</dc:date>
    <item>
      <title>Reclass null values in text field using Calculate Field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647294#M28738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a text field called 'Description' that contains some &amp;lt;Null&amp;gt; values that I wish to update to 'Hedgerows' while keeping all other values the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using&amp;nbsp;Calculate Field in Pro,&amp;nbsp;I tried the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reclass (!Description!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code block&lt;/P&gt;&lt;P&gt;def Reclass(Description):&lt;/P&gt;&lt;P&gt;if (IsNull)&lt;/P&gt;&lt;P&gt;return Hedgerows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression was successfully verified but I then got the following error message when running the tool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error 00539: Error running expression: Reclass (u"Buildings")&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;File "&amp;lt;expression&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;File "&amp;lt;string&amp;gt;, line 2, in Reclass&lt;/P&gt;&lt;P&gt;Name Error: name 'IsNull' is not defined&lt;/P&gt;&lt;P&gt;Failed to execute (CalculateField).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions? I'm a complete novice when it comes to Python.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 12:26:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647294#M28738</guid>
      <dc:creator>DataOfficer</dc:creator>
      <dc:date>2017-12-05T12:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Reclass null values in text field using Calculate Field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647295#M28739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/docs/DOC-8284" target="_blank"&gt;Much Ado About Nothing&lt;/A&gt;&amp;nbsp; &amp;nbsp;is a excellent document written by &lt;A href="https://community.esri.com/people/curtvprice" target="_blank"&gt;curtvprice&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3116" target="_blank"&gt;Dan Patterson&lt;/A&gt;‌&amp;nbsp; describing techniques in dealing with Null values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; reclass &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myString&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; myString &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Hedgerow'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; myString


reclass&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;!Description!&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:27:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647295#M28739</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2021-12-12T03:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reclass null values in text field using Calculate Field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647296#M28740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, I will try this now! Just out of interest, how would this code change if dealing with numerical values rather than string?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 16:31:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647296#M28740</guid>
      <dc:creator>DataOfficer</dc:creator>
      <dc:date>2017-12-05T16:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reclass null values in text field using Calculate Field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647297#M28741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lot of ways to appoach it ... one way is to make the number a string... but the test doesnt care whether or not the variable is a number or string&amp;nbsp; so testing myNumber is None would be valid as well -- It is what you return to the field that is important.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;def&lt;/SPAN&gt; reclass &lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;myNumber&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;if&lt;/SPAN&gt; str(myNumber) &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;is&lt;/SPAN&gt; None&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;return&lt;/SPAN&gt; &lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;911&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;return&lt;/SPAN&gt; myNumber


reclass&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;!NumberField!&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:27:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647297#M28741</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2021-12-12T03:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Reclass null values in text field using Calculate Field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647298#M28742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you're a novice to python, I just wanted to make sure you were aware of the Helpers in Pro:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/385679_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Adding your story about Reclass on this idea &lt;A href="https://community.esri.com/ideas/14182-arcgis-pro-field-calculate-helpers?sr=search&amp;amp;searchId=7dcd3697-1f0a-47b2-9795-067672500724&amp;amp;searchIndex=0"&gt;ArcGIS Pro Field Calculate Helpers&lt;/A&gt;‌ would be worthwhile.&lt;/P&gt;&lt;P&gt;The reclass example is in the doc:&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/calculate-field-examples.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/calculate-field-examples.htm"&gt;Calculate Field examples—Data Management toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; (Ctrl+F 'reclass')&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/385680_pastedImage_3.png" style="width: 620px; height: 357px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That doc on examples might be helpful to you in the future as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 17:48:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647298#M28742</guid>
      <dc:creator>KoryKramer</dc:creator>
      <dc:date>2017-12-05T17:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Reclass null values in text field using Calculate Field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647299#M28743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - this is the example I tried to follow but wasn't sure how to handle 'Null' values (in a string or numeric field). I think I'm beginning to get a better sense of it. What I would really like to see is a feature class version of the 'Reclassify' tool so users that aren't familiar with Python can easily define 'Start' and 'End' values without using code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, thanks for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 10:17:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/reclass-null-values-in-text-field-using-calculate/m-p/647299#M28743</guid>
      <dc:creator>DataOfficer</dc:creator>
      <dc:date>2017-12-06T10:17:34Z</dc:date>
    </item>
  </channel>
</rss>

