<?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: ArcGIS Pro 2.8.4: A python expression fails to perform on “field calculator”, in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197697#M57996</link>
    <description>&lt;P&gt;Thank you for the help. It works fine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_975.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47316iB47FCAFCE94F9CE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_975.jpg" alt="Clip_975.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 30 Jul 2022 11:04:40 GMT</pubDate>
    <dc:creator>JamalNUMAN</dc:creator>
    <dc:date>2022-07-30T11:04:40Z</dc:date>
    <item>
      <title>ArcGIS Pro 2.8.4: A python expression fails to perform on “field calculator”,</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197260#M57932</link>
      <description>&lt;P&gt;ArcGIS Pro 2.8.4: A python expression fails to perform on “field calculator”,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I couldn’t figure out why the python expression below fails to perform on “field calculator&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;!A! + "/"+ !B!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This expression is supposed to combine the field A and field B in field C. The first value in the C table when computed is assumed to be 33 / 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could be the issue here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The gdb file is attached&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_964.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47198iB5D682B30629A09A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_964.jpg" alt="Clip_964.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 09:05:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197260#M57932</guid>
      <dc:creator>JamalNUMAN</dc:creator>
      <dc:date>2022-07-29T09:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.8.4: A python expression fails to perform on “field calculator”,</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197267#M57935</link>
      <description>&lt;P&gt;The error message is telling you that you can't add a string to a number. The "+" operator is for adding numbers &lt;EM&gt;or&lt;/EM&gt; concatenating strings, not adding or concatenating strings to numbers.&lt;/P&gt;&lt;P&gt;Use string formatting instead:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;C = f"{!A!} / {!B!}"

# or 
C = "{} / {}".format(!A!, !B!)

# or
C = "%s / %s" % (!A!, !B!)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 29 Jul 2022 09:23:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197267#M57935</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2022-07-29T09:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.8.4: A python expression fails to perform on “field calculator”,</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197268#M57936</link>
      <description>&lt;P&gt;A and B are floats, "/" is a string.&lt;/P&gt;&lt;P&gt;In Python, addition between float and str isn't defined, so the Field Calculator doesn't know what to do.&lt;/P&gt;&lt;P&gt;You have to convert the floats to strings using one of these methods:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# explicitly cast the floats to strings
str(!A!) + "/" + str(!B!)

# implicitly cast to string with str.format()
"{}/{}".format(!A!, !B!)

# implicitly cast to string with format string
f"{!A!}/{!B!}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 09:29:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197268#M57936</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-07-29T09:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.8.4: A python expression fails to perform on “field calculator”,</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197397#M57948</link>
      <description>&lt;P&gt;The expression (str(!A!) + "/" + str(!B!)) adds one decimal number for each number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to eliminate this decimal number?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_970.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47229i350731191DF65E75/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_970.jpg" alt="Clip_970.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 15:31:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197397#M57948</guid>
      <dc:creator>JamalNUMAN</dc:creator>
      <dc:date>2022-07-29T15:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.8.4: A python expression fails to perform on “field calculator”,</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197567#M57974</link>
      <description>&lt;P&gt;You are making it harder than it has to be.&amp;nbsp; Just don't wrap your Python division character in a string.&amp;nbsp; For example:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;!A! / !B!&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 29 Jul 2022 18:57:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197567#M57974</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2022-07-29T18:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.8.4: A python expression fails to perform on “field calculator”,</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197652#M57993</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp;then&amp;nbsp;will the result be the division of the two numbers (not what OP wants) instead of a string with the two numbers separated by a forward slash (what the OP wants)?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 23:03:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197652#M57993</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2022-07-29T23:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.8.4: A python expression fails to perform on “field calculator”,</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197653#M57994</link>
      <description>&lt;P&gt;Again, use string formatting&lt;/P&gt;&lt;LI-CODE lang="python"&gt;f"{!A!:.0f} / {!B!:.0f}"

"{:.0f} / {:.0f}".format(!A!, !B!)

"%.0f / %.0f" % (!A!, !B!)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 23:02:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197653#M57994</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2022-07-29T23:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.8.4: A python expression fails to perform on “field calculator”,</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197697#M57996</link>
      <description>&lt;P&gt;Thank you for the help. It works fine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_975.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47316iB47FCAFCE94F9CE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_975.jpg" alt="Clip_975.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jul 2022 11:04:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197697#M57996</guid>
      <dc:creator>JamalNUMAN</dc:creator>
      <dc:date>2022-07-30T11:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 2.8.4: A python expression fails to perform on “field calculator”,</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197705#M57998</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10780"&gt;@Luke_Pinner&lt;/a&gt;, I was too quick skimming over the question, thanks for pointing out the real question.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jul 2022 13:17:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-2-8-4-a-python-expression-fails-to/m-p/1197705#M57998</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2022-07-30T13:17:05Z</dc:date>
    </item>
  </channel>
</rss>

