<?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 Python and Field Calculator in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-and-field-calculator/m-p/116082#M9123</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to run the following Python script through Field Calculator&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Parser:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Python&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;calctemp(!Value!)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code Block&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def calctemp(newValue):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; if newValue &amp;gt; 0:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; tempF = (newValue - 273.15)* 1.8000 + 32.00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return tempF&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get a syntax error invalid syntax(&amp;lt;expression&amp;gt;, line 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jun 2014 19:04:40 GMT</pubDate>
    <dc:creator>LeonKincy</dc:creator>
    <dc:date>2014-06-18T19:04:40Z</dc:date>
    <item>
      <title>Python and Field Calculator</title>
      <link>https://community.esri.com/t5/python-questions/python-and-field-calculator/m-p/116082#M9123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to run the following Python script through Field Calculator&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Parser:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Python&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;calctemp(!Value!)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code Block&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def calctemp(newValue):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; if newValue &amp;gt; 0:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; tempF = (newValue - 273.15)* 1.8000 + 32.00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return tempF&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get a syntax error invalid syntax(&amp;lt;expression&amp;gt;, line 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 19:04:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-and-field-calculator/m-p/116082#M9123</guid>
      <dc:creator>LeonKincy</dc:creator>
      <dc:date>2014-06-18T19:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python and Field Calculator</title>
      <link>https://community.esri.com/t5/python-questions/python-and-field-calculator/m-p/116083#M9124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Make sure it is indented properly.&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="lia-code-sample line-numbers language-none"&gt;def calctemp(newValue):
&amp;nbsp; if newValue &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp; tempF = (newValue - 273.15)* 1.8000 + 32.00
&amp;nbsp;&amp;nbsp;&amp;nbsp; return tempF&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:50:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-and-field-calculator/m-p/116083#M9124</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T06:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Python and Field Calculator</title>
      <link>https://community.esri.com/t5/python-questions/python-and-field-calculator/m-p/116084#M9125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I adjusted the indentations, but the error message persists.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 20:23:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-and-field-calculator/m-p/116084#M9125</guid>
      <dc:creator>LeonKincy</dc:creator>
      <dc:date>2014-06-18T20:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Python and Field Calculator</title>
      <link>https://community.esri.com/t5/python-questions/python-and-field-calculator/m-p/116085#M9126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe null (None in Python) values in your Value field?&amp;nbsp; Try changing the if statement to: if newValue is not None and newValue &amp;gt; 0:&amp;nbsp; return...etcAnother possibility: is Value a text field?These don't seem like syntax errors to me, but worth a shot. Maybe also check if Value is the real field name, and not an alias. Again not an expected error, but hey...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 23:40:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-and-field-calculator/m-p/116085#M9126</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2014-06-18T23:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Python and Field Calculator</title>
      <link>https://community.esri.com/t5/python-questions/python-and-field-calculator/m-p/116086#M9127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I still have the error. I uploaded a portion of the data file. Value is long. There is one &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thing I'm not sure about. Value and newValue are suppose to be interchangeable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Value is external to calctemp and is used in the call to calctemp. While newValue is &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;used internally by calctemp.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 17:18:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-and-field-calculator/m-p/116086#M9127</guid>
      <dc:creator>LeonKincy</dc:creator>
      <dc:date>2014-06-20T17:18:01Z</dc:date>
    </item>
  </channel>
</rss>

