<?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: Cell Statistics Bug [SOLVED] in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/cell-statistics-bug/m-p/329383#M11570</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just thought I would answer my own post by mentioning that it isn't a bug with Cell Stats but a problem with the person who wrote the above code &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&amp;nbsp; For those interested here is the way it should be....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rasterlist = []
for rasters in arcpy.ListRasters():
&amp;nbsp;&amp;nbsp;&amp;nbsp; rasterlist.append(rasters)
&amp;nbsp;&amp;nbsp;&amp;nbsp; outcellstats = CellStatistics(rasterlist, "MAXIMUM", "DATA")
outcellstats.save(output + "maximum_2006")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 15:36:09 GMT</pubDate>
    <dc:creator>MatthewNordhagen</dc:creator>
    <dc:date>2021-12-11T15:36:09Z</dc:date>
    <item>
      <title>Cell Statistics Bug</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/cell-statistics-bug/m-p/329382#M11569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All - I was wondering if somebody would be willing to provide some information on a problem I've been having lately with using Cell Statistics in Python?&amp;nbsp; Specifically,&amp;nbsp; I wanted to use Cell Stats to give me the Max cell value for each pixel in a list of 20 rasters.&amp;nbsp; Below is the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;env.workspace = workspace
for rasters in arcpy.ListRasters():
&amp;nbsp;&amp;nbsp;&amp;nbsp; evi = arcpy.Raster(rasters)
CellStats = CellStatistics([evi], "MAXIMUM", "DATA")
CellStats.save(output + "MeanMax")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The result is a raster that has the SUM of all the pixels not the MAX.&amp;nbsp; When using the tool directly in ArcGIS Desktop 10 and I add all 20 of my rasters the output is correct.&amp;nbsp; Any thoughts on why the tool in python is adding all the cells together instead of providing me the max value?&amp;nbsp; Thanks much.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2011 17:06:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/cell-statistics-bug/m-p/329382#M11569</guid>
      <dc:creator>MatthewNordhagen</dc:creator>
      <dc:date>2011-04-20T17:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Cell Statistics Bug [SOLVED]</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/cell-statistics-bug/m-p/329383#M11570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just thought I would answer my own post by mentioning that it isn't a bug with Cell Stats but a problem with the person who wrote the above code &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&amp;nbsp; For those interested here is the way it should be....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rasterlist = []
for rasters in arcpy.ListRasters():
&amp;nbsp;&amp;nbsp;&amp;nbsp; rasterlist.append(rasters)
&amp;nbsp;&amp;nbsp;&amp;nbsp; outcellstats = CellStatistics(rasterlist, "MAXIMUM", "DATA")
outcellstats.save(output + "maximum_2006")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:36:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/cell-statistics-bug/m-p/329383#M11570</guid>
      <dc:creator>MatthewNordhagen</dc:creator>
      <dc:date>2021-12-11T15:36:09Z</dc:date>
    </item>
  </channel>
</rss>

