<?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 Need help with Python Calculations! in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/need-help-with-python-calculations/m-p/432956#M34033</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can anyone please help me with a short program in Python scripting. I need a short program that will allow me to do a field calculation (Such as : population per square mile), and put the answer in a field (POPSQMILE) that was created in the editing session. Anything will help. Thanks!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Apr 2012 13:24:14 GMT</pubDate>
    <dc:creator>MichelleCouden1</dc:creator>
    <dc:date>2012-04-18T13:24:14Z</dc:date>
    <item>
      <title>Need help with Python Calculations!</title>
      <link>https://community.esri.com/t5/python-questions/need-help-with-python-calculations/m-p/432956#M34033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can anyone please help me with a short program in Python scripting. I need a short program that will allow me to do a field calculation (Such as : population per square mile), and put the answer in a field (POPSQMILE) that was created in the editing session. Anything will help. Thanks!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 13:24:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-help-with-python-calculations/m-p/432956#M34033</guid>
      <dc:creator>MichelleCouden1</dc:creator>
      <dc:date>2012-04-18T13:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Python Calculations!</title>
      <link>https://community.esri.com/t5/python-questions/need-help-with-python-calculations/m-p/432957#M34034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you have a population field and a Square miles field you can just run the calculation on the Pop/sq mile field using the field calculator. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The equation will look like&amp;nbsp; [population field]/[sq miles field] in the field calculator&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yielding the result of people per square mile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To access the field calculator right click on the field you want to populate and select Field Calculator from the menu.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No need to dive into Python on this if you dont want to.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 13:28:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-help-with-python-calculations/m-p/432957#M34034</guid>
      <dc:creator>AnthonyTimpson2</dc:creator>
      <dc:date>2012-04-18T13:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Python Calculations!</title>
      <link>https://community.esri.com/t5/python-questions/need-help-with-python-calculations/m-p/432958#M34035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's right - the only situation I can imagine where you would prefer Python over doing the field calculation is if you have many, many features where you need to perform this calculation and you want to automate it.&amp;nbsp; In that situation you might be interested in reading &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000004m000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000004m000000&lt;/A&gt;&lt;SPAN&gt; as this details how to use the field calculator in arcpy.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 13:34:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-help-with-python-calculations/m-p/432958#M34035</guid>
      <dc:creator>RyanForbes1</dc:creator>
      <dc:date>2012-04-18T13:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Python Calculations!</title>
      <link>https://community.esri.com/t5/python-questions/need-help-with-python-calculations/m-p/432959#M34036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I know I can use the field calculator. I need a python program to do the same thing. Calculate two fields into one field. I was wondering if anyone knew how to write such a program. Please help!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 14:34:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-help-with-python-calculations/m-p/432959#M34036</guid>
      <dc:creator>MichelleCouden1</dc:creator>
      <dc:date>2012-04-18T14:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Python Calculations!</title>
      <link>https://community.esri.com/t5/python-questions/need-help-with-python-calculations/m-p/432960#M34037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The link I posted has all of the information you need to make the calculation happen via Python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

# path on the drive to the feature you're trying to manipulate.
inFeature = r"..."

# SQL expression you want to do.
expression = "[field1] + [field2]"

# The name of the output field.
outField = "field3"

# the tool.
arcpy.CalculateField_management(inFeature, outField, expression)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:26:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-help-with-python-calculations/m-p/432960#M34037</guid>
      <dc:creator>RyanForbes1</dc:creator>
      <dc:date>2021-12-11T19:26:38Z</dc:date>
    </item>
  </channel>
</rss>

