<?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: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561984#M43971</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about using:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; field1&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; do something&lt;SPAN class="line-numbers-rows"&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 00:14:42 GMT</pubDate>
    <dc:creator>RandyBurton</dc:creator>
    <dc:date>2021-12-12T00:14:42Z</dc:date>
    <item>
      <title>ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561976#M43963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;I'm trying to label point features with ArcGIS Maplex Engine, using [field1], [field2], [field3], [datefield].&amp;nbsp; My code is set up to label [field1] +&amp;nbsp;'\n'&amp;nbsp;+ [datefield][-2:].&amp;nbsp;&amp;nbsp;If&amp;nbsp;[field1]&amp;nbsp;is null,&amp;nbsp;it'll&amp;nbsp;label [field2] + '\n'&amp;nbsp;+ [field3] +&amp;nbsp;'\n' + [datefield][-2:].&amp;nbsp;&amp;nbsp;For whatever reason, my code doesn't&amp;nbsp;work if a feature has a null&amp;nbsp;value in [datefield].&amp;nbsp; How do I tell my code&amp;nbsp;if the&amp;nbsp;[datefield] is null, label [field1] AND if&amp;nbsp;[datefield] and [field1] is null,&amp;nbsp;label&amp;nbsp;[field2] + '\n' + [field3]?&amp;nbsp; This is my code so far&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def FindLabel ( [field1], [field2], [field3], [datefield] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp; if str([field1]) == "None" :&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [field2] + '\n' + [field3] + '\n' + [datefield][-2:]&lt;BR /&gt;&amp;nbsp; elif str([field1]) != "None" :&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [field1] + '\n' + [datefield][-2:]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I tried adding this section but the engine doesn't seem to read it.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; elif [datefield] == "None" :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [field1]&lt;/P&gt;&lt;P&gt;&amp;nbsp; elif [datefield] == "None" and str([field1]) == "None" :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [field2] + '\n' + [field3]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My entire code is this.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def FindLabel ( [field1], [field2], [field3], [datefield] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp; if str([field1]) == "None" :&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [field2] + '\n' + [field3] + '\n' + [datefield][-2:]&lt;BR /&gt;&amp;nbsp; elif str([field1]) != "None" :&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [field1] + '\n' + [datefield][-2:]&lt;/P&gt;&lt;P&gt;&amp;nbsp; elif [datefield] == "None" :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [field1]&lt;/P&gt;&lt;P&gt;&amp;nbsp; elif [datefield] == "None" and str([field1]) == "None" :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [field2] + '\n' + [field3]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 15:38:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561976#M43963</guid>
      <dc:creator>MichaelHutchison</dc:creator>
      <dc:date>2017-03-09T15:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561977#M43964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your issue is that you are having it check again the string value "None"&amp;nbsp;instead of&amp;nbsp;a None object.&amp;nbsp; Try checking it against the key word None instead of the string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/3289601/null-object-in-python"&gt;http://stackoverflow.com/questions/3289601/null-object-in-python&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest using the if ... is None format in the link for your syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 15:49:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561977#M43964</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-09T15:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561978#M43965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried simplifying it for testing purposes and it did not work for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def FindLabel ( [FIELD1], [DATEFIELD] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if [DATEFIELD] is None :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [FIELD1]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 16:20:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561978#M43965</guid>
      <dc:creator>MichaelHutchison</dc:creator>
      <dc:date>2017-03-09T16:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561979#M43966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually it doing exactly what you are telling it to do.&amp;nbsp; You said if it is a NULL label it a NULL which is nothing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To test if its working I tried having it return something if it was Null:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def FindLabel ( [gasonsite] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp; if [gasonsite] is None:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Value is Null"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had dataset with some NULL values in a field and this expression successfully returned my string for the features that had NULL in that field.&amp;nbsp; When I used the expression you used, it was blank like your probably was.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 16:32:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561979#M43966</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-09T16:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561980#M43967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought about a good way to check and not add Null values to a label expression and here is a sample I used in ArcMap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def FindLabel ( [gasonsite], [featuredlabel], [poweronsite]&amp;nbsp;&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp; fields =&amp;nbsp; ([gasonsite] , [featuredlabel] , [poweronsite]) &lt;BR /&gt;&amp;nbsp; label = ""&lt;BR /&gt;&amp;nbsp; for field in fields:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if field is None:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; continue&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label = label + field + "\n"&lt;BR /&gt;&amp;nbsp; return label&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the value is Null, it add nothing to the label, it is has a value, add it to the label to be returned and add a carriage return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note all my fields I used were strings and if you are using other types you will need to use the str() to convert them prior to concatenating.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 16:42:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561980#M43967</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-09T16:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561981#M43968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ran a quick test with two date fields Birthdate and Expiredate from one of my datasets .....&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; FindLabel &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;BirthDate&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;ExpireDate&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; FindLabel &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;BirthDate&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &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; FindLabel &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Null"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\n'&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; FindLabel &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;BirthDate&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\n'&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;ExpireDate&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &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; FindLabel &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; FindLabel &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Null2"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\n'&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; FindLabel &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; FindLabel &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;ExpireDate&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\n'&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; FindLabel &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Finished Dates"&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;/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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/337362_dateTest.png" style="width: 620px; height: 509px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:14:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561981#M43968</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2021-12-12T00:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561982#M43969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps a variation of this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;field1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None &lt;SPAN class="comment token"&gt;# "Field1"&lt;/SPAN&gt;
field2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Field2"&lt;/SPAN&gt;
field3 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None &lt;SPAN class="comment token"&gt;# "Field3"&lt;/SPAN&gt;
datefield &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None &lt;SPAN class="comment token"&gt;# "2014-12-13"&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field1 &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;datefield &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &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;print&lt;/SPAN&gt; field1 &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\n'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; datefield&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&amp;nbsp; 
&lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;datefield &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; None&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;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\n'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;filter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field3&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; datefield&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\n'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;filter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field3&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/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 00:14:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561982#M43969</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-12T00:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561983#M43970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/337635_is_not_None.png" style="width: 311px; height: 109px;" /&gt;&lt;/P&gt;&lt;P&gt;point raised before, but it is going to be more important in 3.x for future-proofing, because semantically there is only one None, so it is or isn't, hence nothing else can, or cannot be equal to it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2017 01:34:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561983#M43970</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-03-10T01:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561984#M43971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about using:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; field1&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; do something&lt;SPAN class="line-numbers-rows"&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 00:14:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561984#M43971</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-12T00:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561985#M43972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;True, but I don't like to equate None with 'empty'... again preference and semantics and how booleans are created.&amp;nbsp; I sometimes prefer to check for an object type (ie the NoneType) versus and object's state (ie an empty list)a&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;field1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; field1&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"is not None"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"is not necessarily None"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; necessarily None

field1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &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; field1&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"is not None"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"is not necessarily None"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; necessarily None‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/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;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As in this case...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;field1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; isinstance&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;type&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; list&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; tuple&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"could be None"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"is not necessarily None"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
could be None&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 00:14:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561985#M43972</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T00:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561986#M43973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of my&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt; last resort tests&lt;/STRONG&gt;&lt;/SPAN&gt; when nothing else seems to work is equating null to blank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myfield1 = [Field1]+""&lt;/P&gt;&lt;P&gt;if myfield1.strip() = "" then&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;'This could be null'&amp;nbsp;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Python Nulls Strike back!"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2017 16:50:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561986#M43973</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2017-03-10T16:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561987#M43974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I received an error with this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;field1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None
myfield &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; field1&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;
TypeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; unsupported operand type&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NoneType'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'str'&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:14:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561987#M43974</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-12T00:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561988#M43975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ted is maybe using so VB voodoo or the file doesn't contain None's but empty strings. so you would have to do &lt;/P&gt;&lt;P&gt;str(field1) + ""&amp;nbsp; which is pretty useless when you can check for NoneType and/or empty anything with the added conversion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2017 18:05:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561988#M43975</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-03-10T18:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561989#M43976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Back to&amp;nbsp;Michael's question. Check for type None and an empty (zero-length)&amp;nbsp;string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;field1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# "Field1"&lt;/SPAN&gt;
field2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Field2"&lt;/SPAN&gt;
field3 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# "Field3"&lt;/SPAN&gt;
datefield &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"2014-12-13"&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field1 &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; None&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="comment token"&gt;# check for empty string (assuming field1 is a string type)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field1&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"field1 set to none"&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# perhaps a similar check for datefield, etc.&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field1 &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;datefield &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &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;print&lt;/SPAN&gt; field1 &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\n'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; datefield&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&amp;nbsp; 
&lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;datefield &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; None&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;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\n'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;filter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field3&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; datefield&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\n'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;filter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field3&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/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;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 00:14:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561989#M43976</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-12T00:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561990#M43977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And other issues possible with str(None) which equals "None":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;field1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None
myfield &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field1&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myfield&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; myfield

&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt; None
&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:14:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561990#M43977</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-12T00:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561991#M43978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't recall him worried about empty strings, just null attribute table&amp;nbsp;values causing issues in the label.&amp;nbsp; Anyone have fault with my method I posted above?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2017 19:13:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561991#M43978</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-10T19:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561992#M43979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I may have gotten off topic.&amp;nbsp; It was just to clarify the difference between null, type None, and an empty string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2017 19:49:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561992#M43979</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2017-03-10T19:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561993#M43980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I never endorsed the str(None) at all, Randy, just too many things that can be exceptions.&amp;nbsp; Basically with tabular data, work with either checks for the empty string or None using isinstance.&amp;nbsp; This covers shapefiles, file gdb's and numpy, scipy, matplotlib, etc etc at least... everything else is (server stuff etc) is on its own for me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2017 21:56:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561993#M43980</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-03-10T21:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561994#M43981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;... sorry did not convert to Python'ese &amp;nbsp; '-'.join(filter(bool,(field1,"")))&lt;/P&gt;&lt;P&gt;--- and no it is not recommended only if the trustworthy None does not work (field contains unprintable artifact values).&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2017 15:07:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561994#M43981</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2017-03-13T15:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Maplex Python Labeling: If a value in a date field is null, how do I still show other values?</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561995#M43982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like you I thought this turned into a case where None simply does not work as expected ... &amp;nbsp;I do run across that quite often when I deal with data from multiple sources and platforms ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... It is an important distinction knowing Null from Empty String.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;max(None,"") #Returns blank&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;max("Hello","") #Returns Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Helps me quickly determine Nulls and Empty stings ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2017 15:33:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-maplex-python-labeling-if-a-value-in-a-date/m-p/561995#M43982</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2017-03-13T15:33:11Z</dc:date>
    </item>
  </channel>
</rss>

