<?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: Monthly Averages for 30 yr dataset in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/monthly-averages-for-30-yr-dataset/m-p/749504#M57912</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;shouldn't the last four lines be indented as well?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Go figure that it was something that simple. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently running it now and it seems to be working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jun 2014 14:34:45 GMT</pubDate>
    <dc:creator>SarahNiemczura</dc:creator>
    <dc:date>2014-06-19T14:34:45Z</dc:date>
    <item>
      <title>Monthly Averages for 30 yr dataset</title>
      <link>https://community.esri.com/t5/python-questions/monthly-averages-for-30-yr-dataset/m-p/749502#M57910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Morning, I've been digging through the forum for a few days to find a script that could help me. I've currently found:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy arcpy.CheckOutExtension("spatial") arcpy.env.workspace = "F:\\ECV\\netCDFtoRaster" arcpy.env.overwriteOutput = True&amp;nbsp;&amp;nbsp; for year in range(1990,2010):&amp;nbsp; # 1990 through 2010 &amp;nbsp;&amp;nbsp;&amp;nbsp; for month in range(13):&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # 1 to 12 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # wildcard - "ECV_SM_MERG_{1:02d}*.TIF" (format month 1 -&amp;gt; "01") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wild = "ECV_SM_MERG_{1:02d}*.TIF".format(year, month)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rasters = arcpy.ListRasters(wild) # list all rasters for a month &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output = "F:\\ECV\\Month_"+str(month)+"_"+str(year)+".tif" &amp;nbsp;&amp;nbsp;&amp;nbsp; for raster in rasters: # Process: Cell Statistics &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (rasters) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.gp.CellStatistics_sa(rasters, output, "MEAN", "DATA") &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However when I run this, it will only iterate through the 12th month - it will not do the others. How can I make it so the code will iterate through December of all the years, then January, February, and so on? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts would be helpful! Thanks! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SN&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2014 14:18:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/monthly-averages-for-30-yr-dataset/m-p/749502#M57910</guid>
      <dc:creator>SarahNiemczura</dc:creator>
      <dc:date>2014-06-19T14:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly Averages for 30 yr dataset</title>
      <link>https://community.esri.com/t5/python-questions/monthly-averages-for-30-yr-dataset/m-p/749503#M57911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;shouldn't the last four lines be indented as well?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2014 14:24:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/monthly-averages-for-30-yr-dataset/m-p/749503#M57911</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-06-19T14:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly Averages for 30 yr dataset</title>
      <link>https://community.esri.com/t5/python-questions/monthly-averages-for-30-yr-dataset/m-p/749504#M57912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;shouldn't the last four lines be indented as well?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Go figure that it was something that simple. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently running it now and it seems to be working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2014 14:34:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/monthly-averages-for-30-yr-dataset/m-p/749504#M57912</guid>
      <dc:creator>SarahNiemczura</dc:creator>
      <dc:date>2014-06-19T14:34:45Z</dc:date>
    </item>
  </channel>
</rss>

