<?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 with &amp;lt;Null&amp;gt; in ArcGISPro Python in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-with-lt-null-gt-in-arcgispro-python/m-p/1273535#M67386</link>
    <description>&lt;P&gt;The below should work:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def test(x, y):
    if x == 'UNF_GT' and y == None:
        return 'UNF_GT'&lt;/LI-CODE&gt;&lt;P&gt;Try removing the other elif statements.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2023 14:04:10 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2023-03-30T14:04:10Z</dc:date>
    <item>
      <title>Calculate with &lt;Null&gt; in ArcGISPro Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-with-lt-null-gt-in-arcgispro-python/m-p/1273508#M67383</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some troubles calculatin with &amp;lt;Null&amp;gt; values. I have two columns and a want to cearte a third one from it. Col 1 is filled with values. Col 2 has some intentional &amp;lt;Null&amp;gt;. It want Col 3 to be conditionally filled if the value in Col2&amp;nbsp; is &amp;lt;Null&amp;gt;. Below a picture of my attempts, but it seems I do not understand python enough and I didn't find an answer.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 13:30:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-with-lt-null-gt-in-arcgispro-python/m-p/1273508#M67383</guid>
      <dc:creator>DeepSeaMapping</dc:creator>
      <dc:date>2023-03-30T13:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with &lt;Null&gt; in ArcGISPro Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-with-lt-null-gt-in-arcgispro-python/m-p/1273531#M67384</link>
      <description>&lt;P&gt;Would it be an idea to replace first the Null values with a real "0" and then do the calculations?&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/technical-article/000023190" target="_blank"&gt;https://support.esri.com/en/technical-article/000023190&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 13:58:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-with-lt-null-gt-in-arcgispro-python/m-p/1273531#M67384</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2023-03-30T13:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with &lt;Null&gt; in ArcGISPro Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-with-lt-null-gt-in-arcgispro-python/m-p/1273535#M67386</link>
      <description>&lt;P&gt;The below should work:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def test(x, y):
    if x == 'UNF_GT' and y == None:
        return 'UNF_GT'&lt;/LI-CODE&gt;&lt;P&gt;Try removing the other elif statements.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 14:04:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-with-lt-null-gt-in-arcgispro-python/m-p/1273535#M67386</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2023-03-30T14:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with &lt;Null&gt; in ArcGISPro Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-with-lt-null-gt-in-arcgispro-python/m-p/1273550#M67388</link>
      <description>&lt;P&gt;A sample calculation for something unrelated.&lt;/P&gt;&lt;P&gt;If the second fld (fld2 or in your case 'y') is None, then split up what you want return into little bits.&lt;/P&gt;&lt;P&gt;If you have too many bits, you can use a dictionary to extract the value.&amp;nbsp; Be wary of the output type, which in your case is text.&amp;nbsp; Also provide a return value if the second field is not None&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def junk_cal(fld1, fld2):
    """Account for nulls"""
    if fld2 is None:
        if fld1 == 1:
            return "one"
        elif fld1 == 2:
            return "twp"
        elif fld1 == 3:
            return "three"
    return str(fld2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 14:18:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-with-lt-null-gt-in-arcgispro-python/m-p/1273550#M67388</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-03-30T14:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate with &lt;Null&gt; in ArcGISPro Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-with-lt-null-gt-in-arcgispro-python/m-p/1280100#M68133</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 09:26:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-with-lt-null-gt-in-arcgispro-python/m-p/1280100#M68133</guid>
      <dc:creator>DeepSeaMapping</dc:creator>
      <dc:date>2023-04-19T09:26:41Z</dc:date>
    </item>
  </channel>
</rss>

