<?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 Field calculator expression error in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-expression-error/m-p/350130#M15458</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am currently going through Chapter 7 of Getting to Know ArcGIS Pro called Geoenabling Your Project.&lt;/P&gt;&lt;P&gt;I am in part A on step 9. I have taken the following steps:&lt;/P&gt;&lt;P&gt;Open the community housing project&lt;/P&gt;&lt;P&gt;Add the table for household_income&lt;/P&gt;&lt;P&gt;Join the household_income table to the la_census_tracts&lt;/P&gt;&lt;P&gt;Open fields view and create a new field for AMI (Area median income) as a double, numeric, 2 decimal places&lt;/P&gt;&lt;P&gt;Attempt to calculate field for AMI using HHIncome (household_income)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is where I am stuck. The instructions say to enter&lt;/P&gt;&lt;P&gt;! household_income.csv.HHIncome! / 56241 * 100&lt;/P&gt;&lt;P&gt;When I click run it takes about 6.5 minutes. I receive an error message a few minutes in which says:&lt;/P&gt;&lt;P&gt;Warning 002858: Certain rows set to NULL due to error while evaluating python expression: TypeError: unsupported operand type(s) for /: 'NoneType' and 'Int'&lt;/P&gt;&lt;P&gt;Looking at the AMI column, the entire thing reads &amp;lt;null&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried entering others values for it to evaluate, such as setting them all to 6. It eventually failed with an error saying "Something unexpected cause the tool to fail." and "General function failure" while still filling in most of the values to 6, but leaving some at the end of the table as &amp;lt;null&amp;gt;&lt;/P&gt;&lt;P&gt;I also tried using the python box but I am not familiar enough with the software to get much out of that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also looked at the data in the household_income file and found that several HHIncome read as " - " in the excel sheet which translated into ArcGIS Pro as &amp;lt;null&amp;gt; . I am not sure if this has to do with the problem. Others I know have used the same file and not had this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any advice!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Feb 2020 23:08:42 GMT</pubDate>
    <dc:creator>AlexandriaSpofford</dc:creator>
    <dc:date>2020-02-27T23:08:42Z</dc:date>
    <item>
      <title>Field calculator expression error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-expression-error/m-p/350130#M15458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am currently going through Chapter 7 of Getting to Know ArcGIS Pro called Geoenabling Your Project.&lt;/P&gt;&lt;P&gt;I am in part A on step 9. I have taken the following steps:&lt;/P&gt;&lt;P&gt;Open the community housing project&lt;/P&gt;&lt;P&gt;Add the table for household_income&lt;/P&gt;&lt;P&gt;Join the household_income table to the la_census_tracts&lt;/P&gt;&lt;P&gt;Open fields view and create a new field for AMI (Area median income) as a double, numeric, 2 decimal places&lt;/P&gt;&lt;P&gt;Attempt to calculate field for AMI using HHIncome (household_income)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is where I am stuck. The instructions say to enter&lt;/P&gt;&lt;P&gt;! household_income.csv.HHIncome! / 56241 * 100&lt;/P&gt;&lt;P&gt;When I click run it takes about 6.5 minutes. I receive an error message a few minutes in which says:&lt;/P&gt;&lt;P&gt;Warning 002858: Certain rows set to NULL due to error while evaluating python expression: TypeError: unsupported operand type(s) for /: 'NoneType' and 'Int'&lt;/P&gt;&lt;P&gt;Looking at the AMI column, the entire thing reads &amp;lt;null&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried entering others values for it to evaluate, such as setting them all to 6. It eventually failed with an error saying "Something unexpected cause the tool to fail." and "General function failure" while still filling in most of the values to 6, but leaving some at the end of the table as &amp;lt;null&amp;gt;&lt;/P&gt;&lt;P&gt;I also tried using the python box but I am not familiar enough with the software to get much out of that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also looked at the data in the household_income file and found that several HHIncome read as " - " in the excel sheet which translated into ArcGIS Pro as &amp;lt;null&amp;gt; . I am not sure if this has to do with the problem. Others I know have used the same file and not had this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any advice!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2020 23:08:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-expression-error/m-p/350130#M15458</guid>
      <dc:creator>AlexandriaSpofford</dc:creator>
      <dc:date>2020-02-27T23:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculator expression error</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-expression-error/m-p/350131#M15459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SQL NULL get translated to Python None, and you can't do mathematical operators between a numeric type and None.&amp;nbsp; For example, None + 2 will generate a similar error:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; None &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;
Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  File &lt;SPAN class="string token"&gt;"&amp;lt;stdin&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
TypeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; unsupported operand type&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NoneType'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'int'&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is the field name really &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;household_income.csv.HHIncome&lt;/SPAN&gt; ?&amp;nbsp; Geez, that is ugly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears you have NULL values for some of your fields, which you confirm at the end of your post.&amp;nbsp; In situations like this, you either need to have your expression account for an address the possibility of None/NULL, or you need to select all None/NULL records first.&amp;nbsp; I recommend for a beginning using Select Layer By Attribute to make a selection (IS NOT NULL) and then run the field calculator.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:27:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/field-calculator-expression-error/m-p/350131#M15459</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T16:27:42Z</dc:date>
    </item>
  </channel>
</rss>

