<?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: Field classification using field calculator and python script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/field-classification-using-field-calculator-and/m-p/407931#M32143</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Reclass(!LUCode!, !LU_2005!)
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Codeblock:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def Reclass(LUCode, LU_2005):
&amp;nbsp; if LU_2005 == "AG":
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Pasture"
&amp;nbsp; elif LU_2005! == "ST":
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Urban"
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "???"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Python uses &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;==&lt;/SPAN&gt;&lt;SPAN&gt; for equality, and you can't use &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;!Field!&lt;/SPAN&gt;&lt;SPAN&gt;s in the codeblock.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:33:15 GMT</pubDate>
    <dc:creator>JasonScheirer</dc:creator>
    <dc:date>2021-12-11T18:33:15Z</dc:date>
    <item>
      <title>Field classification using field calculator and python script</title>
      <link>https://community.esri.com/t5/python-questions/field-classification-using-field-calculator-and/m-p/407930#M32142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi I'm trying to classify a field based on a land classification value in a different field.&amp;nbsp; I've searched around the forums, but haven't had any success building a working script.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pre-logic Script Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
def Reclass( !LUCode!):
&amp;nbsp; if ( !LU_2005! = "AG")
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Pasture"
&amp;nbsp; if ( !LU_2005! = "ST")
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Urban" 
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LUCode = &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Reclass( !LUCODE!)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 21:44:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-classification-using-field-calculator-and/m-p/407930#M32142</guid>
      <dc:creator>SamNeale</dc:creator>
      <dc:date>2012-08-29T21:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Field classification using field calculator and python script</title>
      <link>https://community.esri.com/t5/python-questions/field-classification-using-field-calculator-and/m-p/407931#M32143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Reclass(!LUCode!, !LU_2005!)
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Codeblock:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def Reclass(LUCode, LU_2005):
&amp;nbsp; if LU_2005 == "AG":
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Pasture"
&amp;nbsp; elif LU_2005! == "ST":
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Urban"
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; return "???"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Python uses &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;==&lt;/SPAN&gt;&lt;SPAN&gt; for equality, and you can't use &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;!Field!&lt;/SPAN&gt;&lt;SPAN&gt;s in the codeblock.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:33:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-classification-using-field-calculator-and/m-p/407931#M32143</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2021-12-11T18:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Field classification using field calculator and python script</title>
      <link>https://community.esri.com/t5/python-questions/field-classification-using-field-calculator-and/m-p/407932#M32144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Great, thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2012 23:00:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-classification-using-field-calculator-and/m-p/407932#M32144</guid>
      <dc:creator>SamNeale</dc:creator>
      <dc:date>2012-08-29T23:00:51Z</dc:date>
    </item>
  </channel>
</rss>

