<?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: label expression in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13125#M1046</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It does not work because Index contains Null values and Null values cannot be converted to Int.&amp;nbsp; So you need to handle Null values (VB Script would throw the same error).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14126365250199172" jivemacro_uid="_14126365250199172" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;def&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; FindLabel ([Contour], [Index]):&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; [Index] == None:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt; ""&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; elif int([Index]) == &lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;:&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; [Contour]&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;:&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; ""&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Oct 2014 23:02:11 GMT</pubDate>
    <dc:creator>RichardFairhurst</dc:creator>
    <dc:date>2014-10-06T23:02:11Z</dc:date>
    <item>
      <title>label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13111#M1032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a attribute table for contours every 10 feet but would like to label ONLY the major contours using the value specified in the Contour field. Found some similar messages but&amp;nbsp; can't get the syntax correct. Please help. New to Python.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 16:32:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13111#M1032</guid>
      <dc:creator>SiranErysian</dc:creator>
      <dc:date>2014-10-06T16:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13112#M1033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s800000034000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//00s800000034000000"&gt;ArcGIS Help 10.1&lt;/A&gt;&amp;nbsp; "Placing labels for contours" should do what you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 17:35:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13112#M1033</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2014-10-06T17:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13113#M1034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #1f497d;"&gt;James,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #1f497d;"&gt;Here is my modification. I have a string field called Line_typ which has the contours I want to label as major. Do I need to have an integer field like you do in the example and have values for each of the line types to choose a number for all those that are called major that I want to label or can I use that string field?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/18263_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #1f497d;"&gt;This did not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: #1f497d;"&gt;Siran&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 18:01:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13113#M1034</guid>
      <dc:creator>SiranErysian</dc:creator>
      <dc:date>2014-10-06T18:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13114#M1035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/18265_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;no luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 18:07:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13114#M1035</guid>
      <dc:creator>SiranErysian</dc:creator>
      <dc:date>2014-10-06T18:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13115#M1036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to wrap your evaluation statement into quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If [Lin_typ] = "major" Then&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 18:16:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13115#M1036</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2014-10-06T18:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13116#M1037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a field called index and used the value 1 for all major contours. See above. Still get error message about line 1 syntax&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 18:23:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13116#M1037</guid>
      <dc:creator>SiranErysian</dc:creator>
      <dc:date>2014-10-06T18:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13117#M1038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you set the field type to Short Integer for the Index field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I setup the same way and do not get any error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 18:34:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13117#M1038</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2014-10-06T18:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13118#M1039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am a big fan of label expressions but since the label expression does not seem to be working for you, why don't you try Label Classes.&amp;nbsp; Change the Method under the Labels tab to "Define classes of features and label each class differently".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next, click on the SQL Query button to essentially do a Definition Query for [Lin_typ] = "Major".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set your Label Field to be [Contour] and then setup the text symbology:&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.esri.com/legacyfs/online/18276_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;Cory&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 19:50:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13118#M1039</guid>
      <dc:creator>CoryMacNeil1</dc:creator>
      <dc:date>2014-10-06T19:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13119#M1040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did set the index field to short integer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 20:12:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13119#M1040</guid>
      <dc:creator>SiranErysian</dc:creator>
      <dc:date>2014-10-06T20:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13120#M1041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right answer! much easier. Will I ever learn Python? I really think its cool...when it works! Thanks so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 20:14:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13120#M1041</guid>
      <dc:creator>SiranErysian</dc:creator>
      <dc:date>2014-10-06T20:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13121#M1042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your expression was actually written for VBScript, not the Python parser.&amp;nbsp; Maybe you should double-check that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 20:54:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13121#M1042</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2014-10-06T20:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13122#M1043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I definitely have the Python parser in the window. Here is my script and error message: What could be wrong?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/18364_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 21:08:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13122#M1043</guid>
      <dc:creator>SiranErysian</dc:creator>
      <dc:date>2014-10-06T21:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13123#M1044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are using a VB Script language Label expression.&amp;nbsp; Python has no Then with an if statement or Function/End Function syntax.&amp;nbsp; For python you have to use == to mean equals in an if statement.&amp;nbsp; A single = assigns a value only in python, which cannot be done here.&amp;nbsp; The Expression that will work for Python is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14126347794905777" jivemacro_uid="_14126347794905777"&gt;
&lt;P&gt;def FindLabel ([Contour], [Index]):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if int([Index]) == 1:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [Contour]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; else:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ""&lt;/P&gt;






&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to convert Index to an Int, because the Label parser automatically converts all field values to string, since only strings make valid labels.&amp;nbsp; Otherwise numeric fields and date fields would throw errors unless you explicitly converted them to string.&amp;nbsp; So you have to convert back to int or flt to make numbers behave like numbers.&amp;nbsp; Alternatively, this will work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14126349466007713 jive_text_macro" jivemacro_uid="_14126349466007713"&gt;
&lt;P&gt;def FindLabel ([Contour], [Index]):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if [Index] == '1':&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [Contour]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; else:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ""&lt;/P&gt;





&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For VB Script it would be:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14126353493159100" jivemacro_uid="_14126353493159100" modifiedtitle="true"&gt;
&lt;P&gt;Function FindLabel ([Contour], [Index])&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If cint([Index]) = 1 Then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FindLabel = [Contour]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Else&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FindLabel = ""&lt;/P&gt;
&lt;P&gt;&amp;nbsp; End If&lt;/P&gt;
&lt;P&gt;End Function&lt;/P&gt;


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 22:35:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13123#M1044</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2014-10-06T22:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13124#M1045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I copied both of these scripts and I still am getting an error! here is a screen shot of the script and error:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/18090_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;I guess the previous people who were trying to help in what I thought was Python, were giving me the VB script!&lt;/P&gt;&lt;P&gt;Why does this still not work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 22:56:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13124#M1045</guid>
      <dc:creator>SiranErysian</dc:creator>
      <dc:date>2014-10-06T22:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13125#M1046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It does not work because Index contains Null values and Null values cannot be converted to Int.&amp;nbsp; So you need to handle Null values (VB Script would throw the same error).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14126365250199172" jivemacro_uid="_14126365250199172" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;def&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; FindLabel ([Contour], [Index]):&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; [Index] == None:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt; ""&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; elif int([Index]) == &lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;:&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; [Contour]&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;:&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; ""&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 23:02:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13125#M1046</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2014-10-06T23:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13126#M1047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey, &lt;/P&gt;&lt;P&gt;I think I figured it out....The index field that has 1's for what I want to label had &amp;lt;NULL&amp;gt; as the value for the one's I do not want to label. Once I changed that to a 0 it labeled them like I wanted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks you so much for the clarification. I will keep that script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 23:06:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13126#M1047</guid>
      <dc:creator>SiranErysian</dc:creator>
      <dc:date>2014-10-06T23:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: label expression</title>
      <link>https://community.esri.com/t5/python-questions/label-expression/m-p/13127#M1048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Be sure to use my last version.&amp;nbsp; If Nulls are at all possible it is best to handle them explicitly in the expression to avoid an error rather than having to eliminate all Null values before the error will stop.&amp;nbsp; If this is a geodatabase you should set the Default value for the Index field to 0 or 1 (or -1 to act as unassigned) to avoid Null values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 23:09:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/label-expression/m-p/13127#M1048</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2014-10-06T23:09:51Z</dc:date>
    </item>
  </channel>
</rss>

