<?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: Using Python in Field Calculator in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107247#M3665</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did not copy all of the code correctly. Still cannot get passed first line of code...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if (!Shape_Area! / 2000) - math.trunc((!Shape_Area! / 2000) + 1) == 0:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; EQ = (!Shape_Area! / 2000) * 30&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; EQ = math.trunc((!Shape_Area! / 2000) + 1) * 30&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Sep 2010 17:17:22 GMT</pubDate>
    <dc:creator>BrianElliott</dc:creator>
    <dc:date>2010-09-23T17:17:22Z</dc:date>
    <item>
      <title>Using Python in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107246#M3664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How can I get this simple code to work using python in the field calculator? I cannot get the syntax correct to save my life.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if (!Shape_Area! / 2000) - (math.trunc (!Shape_Area! / 2000) + 1) = 0:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; EQ = (!Shape_Area! / 2000) * 30&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; EQ = (truncate ((!Shape_Area! / 2000) + 1) * 30&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't get passed the first line without a syntax error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would love any help on this,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 16:46:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107246#M3664</guid>
      <dc:creator>BrianElliott</dc:creator>
      <dc:date>2010-09-23T16:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107247#M3665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did not copy all of the code correctly. Still cannot get passed first line of code...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if (!Shape_Area! / 2000) - math.trunc((!Shape_Area! / 2000) + 1) == 0:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; EQ = (!Shape_Area! / 2000) * 30&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; EQ = math.trunc((!Shape_Area! / 2000) + 1) * 30&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 17:17:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107247#M3665</guid>
      <dc:creator>BrianElliott</dc:creator>
      <dc:date>2010-09-23T17:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107248#M3666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Assuming the indentations are correct, you don't use the ! in the code itself, and you need == not =.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;See the link below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if (Shape_Area / 2000) - (math.trunc (Shape_Area / 2000) + 1) == 0:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.esri.com/news/arcuser/0507/files/pythonscript.pdf"&gt;www.esri.com/news/arcuser/0507/files/pythonscript.pdf&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 17:33:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107248#M3666</guid>
      <dc:creator>GerryGabrisch</dc:creator>
      <dc:date>2010-09-23T17:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107249#M3667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;tested on a shapefile not a geodatabase&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 17:51:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107249#M3667</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2010-09-23T17:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107250#M3668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;THANKS DAN!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to learn more about python, obviously.&amp;nbsp; Your code worked perfectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I can go get a beer. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 18:37:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107250#M3668</guid>
      <dc:creator>BrianElliott</dc:creator>
      <dc:date>2010-09-23T18:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107251#M3669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;pass one through the screen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 22:05:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/using-python-in-field-calculator/m-p/107251#M3669</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2010-09-23T22:05:42Z</dc:date>
    </item>
  </channel>
</rss>

