<?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: I am looking for the integer conversion of a string field in Python functions for the field calculator.  in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94357#M3236</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pamela,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case you run into parser errors with Xander's answer, try it like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/182250_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Feb 2016 15:54:26 GMT</pubDate>
    <dc:creator>ChrisSmith7</dc:creator>
    <dc:date>2016-02-15T15:54:26Z</dc:date>
    <item>
      <title>I am looking for the integer conversion of a string field in Python functions for the field calculator.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94355#M3234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking for the Python function that will allow me to convert a field from a string to a integer in a new field.&amp;nbsp;&amp;nbsp; I do not want to write Python script.&amp;nbsp; It appears that the proper Python function would be .int but it doesn't exist in my field calculator in ArcGIS 10.&amp;nbsp; Please help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 15:23:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94355#M3234</guid>
      <dc:creator>PamelaCaskie</dc:creator>
      <dc:date>2016-02-15T15:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: I am looking for the integer conversion of a string field in Python functions for the field calculator.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94356#M3235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use int(!FieldName!) in the field calculator is the parser is set to Python&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 15:32:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94356#M3235</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-02-15T15:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: I am looking for the integer conversion of a string field in Python functions for the field calculator.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94357#M3236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pamela,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case you run into parser errors with Xander's answer, try it like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/182250_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 15:54:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94357#M3236</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2016-02-15T15:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: I am looking for the integer conversion of a string field in Python functions for the field calculator.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94358#M3237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; s = ["1" ,"2", "", "abc"]&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; [int(i)&amp;nbsp; if i and i.isdigit() else -9999 for i in s]&lt;/P&gt;&lt;P&gt;[1, 2, -9999, -9999]&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[int(i)&amp;nbsp; if i and i.isdigit() else -9999 for i in !FieldName!][0] or&lt;/P&gt;&lt;P&gt;( int(i)&amp;nbsp; if i and i.isdigit() else -9999 for i in !FieldName! )&lt;/P&gt;&lt;P&gt;no arc* to text&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 16:53:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94358#M3237</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-02-15T16:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: I am looking for the integer conversion of a string field in Python functions for the field calculator.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94359#M3238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the INT function does not exist in 10.3 Enterprise edition.&amp;nbsp; However, I have finally found that if you open the Field Calculator and double click the string field that you want to convert, then press string.&amp;nbsp; If your new field is set to Integer, it will automatically convert.&amp;nbsp; Thanks for the help! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 17:37:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94359#M3238</guid>
      <dc:creator>PamelaCaskie</dc:creator>
      <dc:date>2016-02-16T17:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: I am looking for the integer conversion of a string field in Python functions for the field calculator.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94360#M3239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Python is case sensitive. Did you try "int" instead of "INT"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 17:41:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/i-am-looking-for-the-integer-conversion-of-a/m-p/94360#M3239</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-02-16T17:41:14Z</dc:date>
    </item>
  </channel>
</rss>

