<?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: Calculate zonal mean for multiple rasters using Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38342#M3005</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a disconnect between your error message and the script your posted.&lt;/P&gt;&lt;P&gt;Where is this line?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;&lt;CODE&gt;outZonalStatistics &lt;SPAN&gt;=&lt;/SPAN&gt; ZonalStatisticsAsTable......&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/zonal-statistics.htm"&gt;check this link&lt;/A&gt;&lt;/P&gt;&lt;P&gt;the code samples show that you indeed need an assignment And you should create your zone file as an integer raster so that you have explicit control over its cell size and extent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Aug 2017 01:31:55 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2017-08-29T01:31:55Z</dc:date>
    <item>
      <title>Calculate zonal mean for multiple rasters using Python</title>
      <link>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38341#M3004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to calculate the zonal mean (areal precipitation) for grids in a shape file for multiple rasters using a Python script. I have created a script but it gives me an error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated to fix the issue. Please see the code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sa &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcgisscripting&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sys
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;overwriteOutput &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Set environment settings&lt;/SPAN&gt;
env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:/Users/Desktop/KS_All.gdb"&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Make a layer from the feature class &lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Public_Land_Survey_System"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"lyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

&lt;SPAN class="comment token"&gt;# Write the selected features to a new featureclass&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Public_Land_Survey_System"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:/Users/Desktop/KS_All.gdb/PLSS_KS_All_WeeklyPr_PRISM_800m_2016_new"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Set environment settings&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"H:/PRISM_800m_Daily"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Set local variables&lt;/SPAN&gt;
inPointFeatures &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:/Users/Desktop/KS_All.gdb/PLSS_KS_All_WeeklyPr_PRISM_800m_2016_new.shp"&lt;/SPAN&gt;

inRasterList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Week_1_Avg2016_10.tif"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Oct_PCPwk1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Week_2_Avg2016_10.tif"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Oct_PCPwk2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Week_3_Avg2016_10.tif"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Oct_PCPwk3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Week_4_Avg2016_10.tif"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Oct_PCPwk4"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Week_5_Avg2016_10.tif"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Oct_PCPwk5"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Week_1_Avg2016_11.tif"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Nov_PCPwk1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Week_2_Avg2016_11.tif"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Nov_PCPwk2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CheckOutExtension&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Spatial"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

zoneField &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"S_R_T"&lt;/SPAN&gt;
outZonalStatistics &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ZonalStatistics&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inPointFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; zoneField&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; inRasterList&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MEAN"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DATA"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Save the output &lt;/SPAN&gt;
outZonalStatistics&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"C:/Users/Desktop/KS_All.gdb/zonalstattblout"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

fieldName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"YEAR"&lt;/SPAN&gt;
expression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"getClass(!YEAR!)"&lt;/SPAN&gt;
codeblock &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"""def getClass(YEAR):
&amp;nbsp; if YEAR &amp;gt;= 1998:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 2016
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return -9999"""&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Execute CalculateField &lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inPointFeatures&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fieldName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; expression&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PYTHON_9.3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; codeblock&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:29:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38341#M3004</guid>
      <dc:creator>DuminduJayasekera</dc:creator>
      <dc:date>2021-12-10T21:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate zonal mean for multiple rasters using Python</title>
      <link>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38342#M3005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a disconnect between your error message and the script your posted.&lt;/P&gt;&lt;P&gt;Where is this line?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;&lt;CODE&gt;outZonalStatistics &lt;SPAN&gt;=&lt;/SPAN&gt; ZonalStatisticsAsTable......&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/zonal-statistics.htm"&gt;check this link&lt;/A&gt;&lt;/P&gt;&lt;P&gt;the code samples show that you indeed need an assignment And you should create your zone file as an integer raster so that you have explicit control over its cell size and extent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2017 01:31:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38342#M3005</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-08-29T01:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate zonal mean for multiple rasters using Python</title>
      <link>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38343#M3006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan. I have updated the code (Please see the code above) but it is still not doing the job I want. Any idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2017 02:44:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38343#M3006</guid>
      <dc:creator>DuminduJayasekera</dc:creator>
      <dc:date>2017-08-29T02:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate zonal mean for multiple rasters using Python</title>
      <link>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38344#M3007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dumindu, I think you are going to have to throw some print statements in there to ensure that the parameters are indeed correct.&amp;nbsp; And the big one, is the zonal statistics is looking for a polygon file or its raster equivalent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2017 02:52:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38344#M3007</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-08-29T02:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate zonal mean for multiple rasters using Python</title>
      <link>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38345#M3008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK. No error message this time but i cannot see the output.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2017 03:12:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38345#M3008</guid>
      <dc:creator>DuminduJayasekera</dc:creator>
      <dc:date>2017-08-29T03:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate zonal mean for multiple rasters using Python</title>
      <link>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38346#M3009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did it get added to the table of contents?&amp;nbsp; If not, manually add it... better still manually add it to a new dataframe incase the file doesn't have a defined coordinate system and therefore won't play nice with all the other data.&amp;nbsp; If there is nothing to see, then it made it through the process but didn't work... and I would like to see your 'zone' file to make sure it wasn't a point file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2017 03:15:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38346#M3009</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-08-29T03:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate zonal mean for multiple rasters using Python</title>
      <link>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38347#M3010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just checked the shape file and I have used a point shape file. I have corrected to the polygon shape file. (Please see the updated code) But, the code above does not give an error and shows it completed the run. But, I cannot see the output. What am I doing wrong here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2017 03:43:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38347#M3010</guid>
      <dc:creator>DuminduJayasekera</dc:creator>
      <dc:date>2017-08-29T03:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate zonal mean for multiple rasters using Python</title>
      <link>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38348#M3011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you do as I suggested and add the result to a new dataframe?&amp;nbsp; if nothing appeared, use File Explorer and report the file size and save it to the following location and name... there is little point in repeating what isn't working... try a new location, new raster type and see if anything is created... if it works, then figure out how to get what where you want it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV style="display: block;"&gt;&lt;DIV&gt;&lt;DIV data-linkedid="communications_2_711298_14_2145"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV data-extendedauthors="false" data-extvisible="false" data-objectid="711298" data-objecttype="2"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;outZonalStatistics&lt;SPAN&gt;.&lt;/SPAN&gt;save&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"C:/temp/x.tif"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 15:56:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38348#M3011</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T15:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate zonal mean for multiple rasters using Python</title>
      <link>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38349#M3012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ran the code upto inPointFeatures line in Python window in ArcGIS and gave this error below. Seems to be the code is correct. Cannot understand why.&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;Runtime error&amp;nbsp; Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; File &lt;SPAN class="string token"&gt;"&amp;lt;string&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;13&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; File &lt;SPAN class="string token"&gt;"c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\management.py"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;6477&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; MakeFeatureLayer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;raise&lt;/SPAN&gt; e ExecuteError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; ERROR &lt;SPAN class="number token"&gt;000622&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; Failed to execute &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Make Feature Layer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt; Parameters are &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; valid&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt; ERROR &lt;SPAN class="number token"&gt;000628&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; Cannot set input into parameter in_features&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2017 15:16:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38349#M3012</guid>
      <dc:creator>DuminduJayasekera</dc:creator>
      <dc:date>2017-08-29T15:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate zonal mean for multiple rasters using Python</title>
      <link>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38350#M3013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;one of these two is wrong.... do the process manually, go to the Results window and copy the python syntax.... ps... your output filename PL..... shouldn't be that long, you might be asking for trouble when you get into long filenames, pathnames and older versions of python&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV style="display: block;"&gt;&lt;DIV&gt;&lt;DIV data-linkedid="communications_2_711298_14_2145"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV data-extendedauthors="false" data-extvisible="false" data-objectid="711298" data-objecttype="2"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;SPAN&gt;"Public_Land_Survey_System"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; r&lt;SPAN&gt;"C:/Users/Desktop/KS_All.gdb/PLSS_KS_All_WeeklyPr_PRISM_800m_2016_new"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2017 15:42:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38350#M3013</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-08-29T15:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate zonal mean for multiple rasters using Python</title>
      <link>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38351#M3014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if the code represents the latest version of what you are trying to run, but I noticed that you used the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;inPointFeatures &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:/Users/Desktop/KS_All.gdb/PLSS_KS_All_WeeklyPr_PRISM_800m_2016_new.shp"&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case you are trying the write a shapefile in the "folder" that is a file geodatabase. You should loose the "&lt;STRONG&gt;.shp&lt;/STRONG&gt;" at the end of the statement. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If possible you could share a sample of your data to see if the error can be reproduced&amp;nbsp;and to correct any errors in the code.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2017 12:45:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-zonal-mean-for-multiple-rasters-using/m-p/38351#M3014</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-08-31T12:45:27Z</dc:date>
    </item>
  </channel>
</rss>

