<?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: Error migrating python label expression from Arcmap to Arc Pro in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/error-migrating-python-label-expression-from/m-p/1112157#M47294</link>
    <description>&lt;P&gt;It was actually&lt;/P&gt;&lt;P&gt;if &amp;lt;!field!&amp;gt; == None:&lt;BR /&gt;pass&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt;Happy retirement!&lt;/P&gt;</description>
    <pubDate>Thu, 28 Oct 2021 15:30:11 GMT</pubDate>
    <dc:creator>JoanHickey</dc:creator>
    <dc:date>2021-10-28T15:30:11Z</dc:date>
    <item>
      <title>Error migrating python label expression from Arcmap to Arc Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/error-migrating-python-label-expression-from/m-p/1111750#M47247</link>
      <description>&lt;P&gt;I have a python label expression that works in arcmap, but when I try it in ArcPro, I get an AttributeError:&amp;nbsp; "NoneType' object has not attribute 'strip'.&amp;nbsp; I think this might happen because there are null values in my data (just a guess).&amp;nbsp; Here is the expression:&amp;nbsp;&lt;/P&gt;&lt;P&gt;def FindLabel ( [PAD_addr],[UnitsRes],[NumBldgs]):&lt;BR /&gt;S =[PAD_addr].strip()&lt;BR /&gt;i = S.find('(')&lt;BR /&gt;nres = long([UnitsRes])&lt;BR /&gt;nbldg = long([NumBldgs])&lt;BR /&gt;if i == -1:&lt;BR /&gt;tmp = S.replace('::','\n')&lt;BR /&gt;elif i &amp;gt; 0:&lt;BR /&gt;tmp = S[0:i]&lt;BR /&gt;if nbldg &amp;gt; 1:&lt;BR /&gt;tmp2 = ' on lot)'&lt;BR /&gt;else:&lt;BR /&gt;tmp2 = ')'&lt;BR /&gt;if nres == 0:&lt;BR /&gt;return tmp + '\n(no res units)'&lt;BR /&gt;elif nres == 1:&lt;BR /&gt;return tmp + '\n(' + str(nres) + ' res unit' + tmp2&lt;BR /&gt;else:&lt;BR /&gt;return tmp + '\n(' + str(nres) + ' res units' + tmp2&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 17:26:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/error-migrating-python-label-expression-from/m-p/1111750#M47247</guid>
      <dc:creator>JoanHickey</dc:creator>
      <dc:date>2021-10-27T17:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Error migrating python label expression from Arcmap to Arc Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/error-migrating-python-label-expression-from/m-p/1111825#M47255</link>
      <description>&lt;P&gt;Trap for null values and use a pass:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if &amp;lt;!field!&amp;gt; is null:
    pass
else:
   #do the rest of the mojo&lt;/LI-CODE&gt;&lt;P&gt;(not tested...)&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 19:19:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/error-migrating-python-label-expression-from/m-p/1111825#M47255</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-10-27T19:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Error migrating python label expression from Arcmap to Arc Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/error-migrating-python-label-expression-from/m-p/1111929#M47275</link>
      <description>&lt;P&gt;or query your data for null values, switch the selection, then use your function&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to make code easier to read&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 22:41:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/error-migrating-python-label-expression-from/m-p/1111929#M47275</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-10-27T22:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Error migrating python label expression from Arcmap to Arc Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/error-migrating-python-label-expression-from/m-p/1112099#M47292</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/41696"&gt;@JoanHickey&lt;/a&gt;&amp;nbsp;- this is&amp;nbsp; a better solution for you.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 14:24:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/error-migrating-python-label-expression-from/m-p/1112099#M47292</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-10-28T14:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Error migrating python label expression from Arcmap to Arc Pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/error-migrating-python-label-expression-from/m-p/1112157#M47294</link>
      <description>&lt;P&gt;It was actually&lt;/P&gt;&lt;P&gt;if &amp;lt;!field!&amp;gt; == None:&lt;BR /&gt;pass&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt;Happy retirement!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 15:30:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/error-migrating-python-label-expression-from/m-p/1112157#M47294</guid>
      <dc:creator>JoanHickey</dc:creator>
      <dc:date>2021-10-28T15:30:11Z</dc:date>
    </item>
  </channel>
</rss>

