<?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: Python expressions in field calculator in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-expressions-in-field-calculator/m-p/675937#M52336</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I find the python docs succinct and complete&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.python.org/3/tutorial/introduction.html?highlight=slice" title="https://docs.python.org/3/tutorial/introduction.html?highlight=slice"&gt;3. An Informal Introduction to Python — Python 3.7.4 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Sep 2019 10:50:18 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2019-09-19T10:50:18Z</dc:date>
    <item>
      <title>Python expressions in field calculator</title>
      <link>https://community.esri.com/t5/python-questions/python-expressions-in-field-calculator/m-p/675935#M52334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm transitioning from ArcMap to ArcGIS Pro - no experience of Python but would like to learn.&lt;/P&gt;&lt;P&gt;I'm trying to run a very simple string function&amp;nbsp;to&amp;nbsp;remove four&amp;nbsp;digits at the end of&amp;nbsp;text field. In&amp;nbsp;ArcMap VB Script I would do the following:&lt;/P&gt;&lt;P&gt;Left([FieldName],Len([FieldName])-4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't see how to do the same in&amp;nbsp;Python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There seem to be relatively few examples here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/manage-data/tables/calculate-field-examples.htm#ESRI_SECTION1_2C1A27476FD54D949723FA8DFC9306B2" title="http://desktop.arcgis.com/en/arcmap/10.3/manage-data/tables/calculate-field-examples.htm#ESRI_SECTION1_2C1A27476FD54D949723FA8DFC9306B2"&gt;Calculate Field examples—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&amp;nbsp;the link to the build in functions of Python returns a 404 error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a good resource that sets out the functions and arguments for Python in ArcGIS?&amp;nbsp; I have googled but can't find what I'm looking for!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2019 10:30:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-expressions-in-field-calculator/m-p/675935#M52334</guid>
      <dc:creator>HelenCooper</dc:creator>
      <dc:date>2019-09-19T10:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python expressions in field calculator</title>
      <link>https://community.esri.com/t5/python-questions/python-expressions-in-field-calculator/m-p/675936#M52335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;perhaps&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'1234567890'&lt;/SPAN&gt;

a&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;'123456'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# ---- if 'a' were the field name, you would use !a![:-4] in the field calculator‍‍‍‍‍‍‍‍‍‍‍‍&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;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:29:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-expressions-in-field-calculator/m-p/675936#M52335</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T04:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Python expressions in field calculator</title>
      <link>https://community.esri.com/t5/python-questions/python-expressions-in-field-calculator/m-p/675937#M52336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I find the python docs succinct and complete&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.python.org/3/tutorial/introduction.html?highlight=slice" title="https://docs.python.org/3/tutorial/introduction.html?highlight=slice"&gt;3. An Informal Introduction to Python — Python 3.7.4 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2019 10:50:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-expressions-in-field-calculator/m-p/675937#M52336</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-09-19T10:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python expressions in field calculator</title>
      <link>https://community.esri.com/t5/python-questions/python-expressions-in-field-calculator/m-p/675938#M52337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan,&amp;nbsp;&lt;/P&gt;&lt;P&gt;That worked perfectly - any suggestions on&amp;nbsp;good resources&amp;nbsp;for learning?&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2019 10:51:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-expressions-in-field-calculator/m-p/675938#M52337</guid>
      <dc:creator>HelenCooper</dc:creator>
      <dc:date>2019-09-19T10:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Python expressions in field calculator</title>
      <link>https://community.esri.com/t5/python-questions/python-expressions-in-field-calculator/m-p/675939#M52338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect,&amp;nbsp;I will take a look, very many thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2019 10:51:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-expressions-in-field-calculator/m-p/675939#M52338</guid>
      <dc:creator>HelenCooper</dc:creator>
      <dc:date>2019-09-19T10:51:41Z</dc:date>
    </item>
  </channel>
</rss>

