<?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: Invalid literal for int() with base 10. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/invalid-literal-for-int-with-base-10/m-p/556852#M43532</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your variables in Quakesim_List are strings, hence the failure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family:Courier New;"&gt;int(max(float(sim) for sim in Quakesim_List))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do that.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jul 2013 23:33:27 GMT</pubDate>
    <dc:creator>JasonScheirer</dc:creator>
    <dc:date>2013-07-23T23:33:27Z</dc:date>
    <item>
      <title>Invalid literal for int() with base 10.</title>
      <link>https://community.esri.com/t5/python-questions/invalid-literal-for-int-with-base-10/m-p/556849#M43529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I keep getting this error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Traceback (most recent call last): &amp;nbsp; File "C:\Users\sbarron\Desktop\AIDA_Tool\AutoInfastructureMask.py", line 123, in &amp;lt;module&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; Max= int(max(Quakesim_List)) ValueError: invalid literal for int() with base 10: '999.332202045'&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And I have no idea why. This code has worked on bigger numbers than this one, so I'm completely stumped. Any help would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 21:51:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-literal-for-int-with-base-10/m-p/556849#M43529</guid>
      <dc:creator>ScottBarron</dc:creator>
      <dc:date>2013-07-23T21:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid literal for int() with base 10.</title>
      <link>https://community.esri.com/t5/python-questions/invalid-literal-for-int-with-base-10/m-p/556850#M43530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oh and for reference, the list in the code is just a list full of floating point numbers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 21:55:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-literal-for-int-with-base-10/m-p/556850#M43530</guid>
      <dc:creator>ScottBarron</dc:creator>
      <dc:date>2013-07-23T21:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid literal for int() with base 10.</title>
      <link>https://community.esri.com/t5/python-questions/invalid-literal-for-int-with-base-10/m-p/556851#M43531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It appears that maybe your list contains strings&amp;nbsp; '999.332202045'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try this, might work for you, will make sure if string, converts to float, then int:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; Max= int(float(max(Quakesim_List)))&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 23:11:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-literal-for-int-with-base-10/m-p/556851#M43531</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2013-07-23T23:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid literal for int() with base 10.</title>
      <link>https://community.esri.com/t5/python-questions/invalid-literal-for-int-with-base-10/m-p/556852#M43532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your variables in Quakesim_List are strings, hence the failure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family:Courier New;"&gt;int(max(float(sim) for sim in Quakesim_List))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do that.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 23:33:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-literal-for-int-with-base-10/m-p/556852#M43532</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2013-07-23T23:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid literal for int() with base 10.</title>
      <link>https://community.esri.com/t5/python-questions/invalid-literal-for-int-with-base-10/m-p/556853#M43533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Apparently it was a case of bad data. I tried with the float inserted into the code and it worked but it gave me a messed up output. I regenerated the data and it worked just fine. Thanks for your help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 16:40:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/invalid-literal-for-int-with-base-10/m-p/556853#M43533</guid>
      <dc:creator>ScottBarron</dc:creator>
      <dc:date>2013-07-24T16:40:55Z</dc:date>
    </item>
  </channel>
</rss>

