<?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: Getting min and max from list of arcobjects in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535524#M41951</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi Jacob,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you cannot use the built-in min/max function names as variable names.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;change them to for example to Rmin/Rmax or something else.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i don´t quite understand what "else" is in there for.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Rmin = arcpy.GetRasterProperties_management(file, "MINIMUM")
Rmax = arcpy.GetRasterProperties_management(file, "MAXIMUM")

rastmin.append(float(Rmin.getOutput(0)))
rastmax.append(float(Rmax.getOutput(0)))
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 23:16:09 GMT</pubDate>
    <dc:creator>RaphaelR</dc:creator>
    <dc:date>2021-12-11T23:16:09Z</dc:date>
    <item>
      <title>Getting min and max from list of arcobjects</title>
      <link>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535523#M41950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm working on a simple script that will extract the lowest and highest values present from a group on input rasters. The values seem to be extracted to the lists properly but when I try to run the min and max function on the list I get an error: &lt;/SPAN&gt;&lt;SPAN style="color:#FF0000;"&gt;Runtime error &amp;lt;type 'exceptions.TypeError'&amp;gt;: 'list' object is not callable&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy
from arcpy import env
inputs = arcpy.GetParameterAsText(0)
worklist = inputs.split(";")

rastmin = list()
rastmax = list()

for file in worklist:
&amp;nbsp;&amp;nbsp;&amp;nbsp; min = arcpy.GetRasterProperties_management(file, "MINIMUM")
&amp;nbsp;&amp;nbsp;&amp;nbsp; max = arcpy.GetRasterProperties_management(file, "MAXIMUM")
&amp;nbsp;&amp;nbsp;&amp;nbsp; rastmin.append(float(min.getOutput(0)))
&amp;nbsp;&amp;nbsp;&amp;nbsp; rastmax.append(float(max.getOutput(0)))

else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; x = min(rastmin)
&amp;nbsp;&amp;nbsp;&amp;nbsp; y = max(rastmax)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(x)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(y) &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2012 13:49:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535523#M41950</guid>
      <dc:creator>JacobFraser</dc:creator>
      <dc:date>2012-01-24T13:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Getting min and max from list of arcobjects</title>
      <link>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535524#M41951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi Jacob,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you cannot use the built-in min/max function names as variable names.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;change them to for example to Rmin/Rmax or something else.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i don´t quite understand what "else" is in there for.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Rmin = arcpy.GetRasterProperties_management(file, "MINIMUM")
Rmax = arcpy.GetRasterProperties_management(file, "MAXIMUM")

rastmin.append(float(Rmin.getOutput(0)))
rastmax.append(float(Rmax.getOutput(0)))
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:16:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535524#M41951</guid>
      <dc:creator>RaphaelR</dc:creator>
      <dc:date>2021-12-11T23:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting min and max from list of arcobjects</title>
      <link>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535525#M41952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for pointing that out Rafael, I fixed that but still get the same error. The rastmin and rastmax lists seem to get filled correctly and when I do a type() on the items in the list it says they are float.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2012 14:45:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535525#M41952</guid>
      <dc:creator>JacobFraser</dc:creator>
      <dc:date>2012-01-24T14:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Getting min and max from list of arcobjects</title>
      <link>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535526#M41953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;weird, i just put your code into a sample tool and i think it worked (prints out the absolute max and min from the rasters).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;what did you use for the input parameter?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i used "Raster Layer" and set it to multivalue.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2012 15:06:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535526#M41953</guid>
      <dc:creator>RaphaelR</dc:creator>
      <dc:date>2012-01-24T15:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Getting min and max from list of arcobjects</title>
      <link>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535527#M41954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Weird indeed, I just restarted ArcMap again and now it works. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2012 15:32:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535527#M41954</guid>
      <dc:creator>JacobFraser</dc:creator>
      <dc:date>2012-01-24T15:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Getting min and max from list of arcobjects</title>
      <link>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535528#M41955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Don't forget to use the "result object"! The syntax would actually be like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;min = arcpy.GetRasterProperties_management(file, "MINIMUM").GetOutput(0)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2012 17:07:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/getting-min-and-max-from-list-of-arcobjects/m-p/535528#M41955</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-01-24T17:07:39Z</dc:date>
    </item>
  </channel>
</rss>

