<?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 the NULL value using a Field Calculator in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552593#M43143</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I already tried to do this. I received an error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000539: error running expression: NONE &amp;lt;type'exceptions.NameError'&amp;gt; name 'NONE' is not defined.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use None (not a NONE like above) there is no error, but also nothing happen.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Sep 2012 16:56:01 GMT</pubDate>
    <dc:creator>JoannaLaroussi</dc:creator>
    <dc:date>2012-09-12T16:56:01Z</dc:date>
    <item>
      <title>Calculate the NULL value using a Field Calculator</title>
      <link>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552589#M43139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a field type string with the values of ???A???, ???B??? and ???C??? and NULL (empty string). I would like to replace selected letter values with NULL, which will be an empty string, not a string ???NULL???. I tried to use in a field calculator a Python parser:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;str!field_name!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but this did not work. I found plenty of posts how to select a NULL value, but nothing helpful on how to calculate NULL in a way that it is visible as NULL/empty string also through SQL server connection. Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 19:34:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552589#M43139</guid>
      <dc:creator>JoannaLaroussi</dc:creator>
      <dc:date>2012-09-11T19:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the NULL value using a Field Calculator</title>
      <link>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552590#M43140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When using python, use "None" instead of Null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PRELOGIC SCRIPT CODE:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
def testIt(field):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if field in ['A', 'B']:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field = None
&amp;nbsp;&amp;nbsp;&amp;nbsp; return field
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;TYPE=&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;testIt(!yourfield!)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:53:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552590#M43140</guid>
      <dc:creator>KevinBell</dc:creator>
      <dc:date>2021-12-11T23:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the NULL value using a Field Calculator</title>
      <link>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552591#M43141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for your answer. I run it and nothing happened. Anyway, I do not want to replace all my �??A�?� or �??B�?�, but I am looking for a way to calculate NULL /None value for only selected rows.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 12:32:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552591#M43141</guid>
      <dc:creator>JoannaLaroussi</dc:creator>
      <dc:date>2012-09-12T12:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the NULL value using a Field Calculator</title>
      <link>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552592#M43142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;then don't use the codeblock and just use None which is null to python.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 14:33:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552592#M43142</guid>
      <dc:creator>KevinBell</dc:creator>
      <dc:date>2012-09-12T14:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the NULL value using a Field Calculator</title>
      <link>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552593#M43143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I already tried to do this. I received an error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000539: error running expression: NONE &amp;lt;type'exceptions.NameError'&amp;gt; name 'NONE' is not defined.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use None (not a NONE like above) there is no error, but also nothing happen.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2012 16:56:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552593#M43143</guid>
      <dc:creator>JoannaLaroussi</dc:creator>
      <dc:date>2012-09-12T16:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the NULL value using a Field Calculator</title>
      <link>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552594#M43144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.MakeFeatureLayer(fc, "lyr", "MY_FIELD in ('A','B')":
if int(arcpy.GetCount_management("fl").getOutput(0)) &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_managment("fl", "MY_FIELD", "None", "PYTHON")&lt;/PRE&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.MakeFeatureLayer(fc, "lyr", "MY_FIELD in ('A','B')":
if int(arcpy.GetCount_management("fl").getOutput(0)) &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_managment("fl", "MY_FIELD", "NULL", "VB")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:53:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552594#M43144</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T23:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the NULL value using a Field Calculator</title>
      <link>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552595#M43145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for your solutions. I had a problem with making it work: both codes returned an invalid syntax error and highlighted �??:�?� in a code. I did not do more research on this error, because I got another solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just learned that in ArcGIS 10 Null can be simply calculated in a field calculator by typing Null (VB parser) in a calculator window. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My mistake is that after trying to do this for a single record during the edit session, I assumed that it is not working at all and did not try to use VB parser in a field calculator.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2012 18:19:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-the-null-value-using-a-field-calculator/m-p/552595#M43145</guid>
      <dc:creator>JoannaLaroussi</dc:creator>
      <dc:date>2012-09-13T18:19:25Z</dc:date>
    </item>
  </channel>
</rss>

