<?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: Not sure how to fix an Index Error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336302#M26387</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm OK with getting a little off topic if the topic leads me to produce the results I need. Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Oct 2015 15:08:50 GMT</pubDate>
    <dc:creator>RachelAlbritton</dc:creator>
    <dc:date>2015-10-01T15:08:50Z</dc:date>
    <item>
      <title>Not sure how to fix an Index Error</title>
      <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336293#M26378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working on updating a python script that was created in python 2.6 for ArcGIS 10.0.&lt;/P&gt;&lt;P&gt;We are now working with python 2.7.8 in ArcGIS 10.3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not write the script and am still a little fuzzy on exactly what its doing (which is probably why I need help figuring out this error).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script is performing a Moore Neighborhood analysis on an array where it's walking through each cell in the DEM raster and comparing that cell value to the 8 surrounding cells, it extracts a minimum value from those 8 cells and then inserts that value into a corresponding constant array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script runs through the first 3 if statements ok, but then gets to the 4th one and throws the error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "S:\Rachel\Projects\Storm_Sewer\Python\Surface_Flow.py", line 51, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray[u-1][v+1]:&lt;/V&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;IndexError: index 3510 is out of bounds for axis 0 with size 3510&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Presumably, the script is calculating something outside a a predefined range but I'm not sure what that is and/or how to fix it so that the script still returns the correct values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both the original DEM and constant raster's were floating values before turning them into arrays. Not sure if that's relevant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SCRIPT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#Global Variables:
t=numpy.empty((49,1))
c=0

#Turn DEM into an array matrix.
myArray = arcpy.RasterToNumPyArray(DEM)
constant2 = arcpy.RasterToNumPyArray(constant)

#Moore Neighborhood Analysis
#Neighboorhood Analysis&amp;nbsp; will walk through each cell comparing all surrounding
#cells, extract minimum values, and insert them into the constant raster location

for u in range(len(myArray)-1):
&amp;nbsp;&amp;nbsp;&amp;nbsp; for v in range(len(myArray)-1):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray[u-1]&lt;V&gt;:&lt;/V&gt;&lt;/V&gt;&lt;/U&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2[u-1]&lt;V&gt;=myArray[u-1]&lt;V&gt;&lt;/V&gt;&lt;/V&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray[u+1]&lt;V&gt;:&lt;/V&gt;&lt;/V&gt;&lt;/U&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2[u+1]&lt;V&gt;=myArray[u+1]&lt;V&gt;&lt;/V&gt;&lt;/V&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray[u-1][v-1]:&lt;/V&gt;&lt;/U&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2[u-1][v-1]=myArray[u-1][v-1]

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray[u-1][v+1]:&lt;/V&gt;&lt;/U&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2[u-1][v+1]=myArray[u-1][v+1]

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if myArray[u+1][v+1]&amp;gt;myArray[u+1][v+1]:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2 [u+1][v+1]=myArray[u+1][v+1]

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray[u+1][v-1]:&lt;/V&gt;&lt;/U&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2 [u+1][v-1]=myArray[u+1][v-1]

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray&lt;U&gt;[v+1]:&lt;/U&gt;&lt;/V&gt;&lt;/U&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2&lt;U&gt;[v+1]=myArray&lt;U&gt;[v+1]&lt;/U&gt;&lt;/U&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if myArray&lt;U&gt;[v-1]&amp;gt;myArray&lt;U&gt;[v-1]:&lt;/U&gt;&lt;/U&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2&lt;U&gt;[v-1]=myArray&lt;U&gt;[v-1]&lt;/U&gt;&lt;/U&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:56:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336293#M26378</guid>
      <dc:creator>RachelAlbritton</dc:creator>
      <dc:date>2021-12-11T15:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to fix an Index Error</title>
      <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336294#M26379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There seems to be some inconsistency in you code :&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1443637637042749 jive_text_macro" data-renderedposition="29_8_912_329" jivemacro_uid="_1443637637042749"&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;for u &lt;SPAN class="keyword"&gt;in&lt;/SPAN&gt; range(len(myArray)-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;):&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;for v &lt;SPAN class="keyword"&gt;in&lt;/SPAN&gt; range(len(myArray)-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;):&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray[u-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]&lt;V&gt;:&amp;nbsp; &lt;/V&gt;&lt;/V&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2[u-&lt;SPAN class="number"&gt;1]&lt;V&gt;=myArray[u-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]&lt;V&gt;&amp;nbsp; &lt;/V&gt;&lt;/V&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray[u+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]&lt;V&gt;:&amp;nbsp; &lt;/V&gt;&lt;/V&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2[u+&lt;SPAN class="number"&gt;1]&lt;V&gt;=myArray[u+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]&lt;V&gt;&amp;nbsp; &lt;/V&gt;&lt;/V&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray[u-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;][v-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]:&amp;nbsp; &lt;/V&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2[u-&lt;SPAN class="number"&gt;1][v-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]=myArray[u-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;][v-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray[u-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;][v+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]:&amp;nbsp; &lt;/V&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2[u-&lt;SPAN class="number"&gt;1][v+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]=myArray[u-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;][v+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;if myArray[u+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;][v+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]&amp;gt;myArray[u+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;][v+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]:&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2 [u+&lt;SPAN class="number"&gt;1][v+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]=myArray[u+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;][v+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray[u+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;][v-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]:&amp;nbsp; &lt;/V&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2 [u+&lt;SPAN class="number"&gt;1][v-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]=myArray[u+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;][v-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;if myArray&lt;U&gt;&lt;V&gt;&amp;gt;myArray&lt;U&gt;[v+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]:&amp;nbsp; &lt;/U&gt;&lt;/V&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2&lt;U&gt;[v+&lt;SPAN class="number"&gt;1]=myArray&lt;U&gt;[v+&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]&amp;nbsp; &lt;/U&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;if myArray&lt;U&gt;[v-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]&amp;gt;myArray&lt;U&gt;[v-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]:&amp;nbsp; &lt;/U&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constant2&lt;U&gt;[v-&lt;SPAN class="number"&gt;1]=myArray&lt;U&gt;[v-&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;]&amp;nbsp; &lt;/U&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gee that's looks terrible on my side.&lt;/P&gt;&lt;P&gt;All the "ifs" are comparing myArray(&lt;U&gt;,v]) with the cells around it. Except at lines 11 &amp;amp; 17 (I think)&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Why is that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2015 18:29:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336294#M26379</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2015-09-30T18:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to fix an Index Error</title>
      <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336295#M26380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then, why not just run a raster filter for Min on the original raster with a 3X3 processing window?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2015 18:32:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336295#M26380</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2015-09-30T18:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to fix an Index Error</title>
      <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336296#M26381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't suppose you can tell me what the shape and number of dimensions the input and constant raster have?&amp;nbsp; And perhaps you can elaborate on what t=numpy.empty((&lt;SPAN class="number"&gt;49,&lt;SPAN class="number"&gt;1&lt;/SPAN&gt;)) is supposed to be...is that the destination array? (which will only hold 49 rows and 1 column of data. What is constant? c? are there lines of code missing? Could you provide the un-updated script that you know worked?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2015 18:49:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336296#M26381</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-09-30T18:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to fix an Index Error</title>
      <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336297#M26382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The route makes a lot more sense. I ran the tool, but the output was exactly the same as the input. I find that odd, don't you?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2015 18:51:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336297#M26382</guid>
      <dc:creator>RachelAlbritton</dc:creator>
      <dc:date>2015-09-30T18:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to fix an Index Error</title>
      <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336298#M26383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both the original input DEM &amp;amp; constant rasters are 3510 (columns) and 3645 (rows)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still trying figure out what the Global variables are there for as well. I commented them out to see if it would make a difference and I still got the same error. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2015 18:55:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336298#M26383</guid>
      <dc:creator>RachelAlbritton</dc:creator>
      <dc:date>2015-09-30T18:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to fix an Index Error</title>
      <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336299#M26384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You ran this tool on your data...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FocalStatstics_Min.jpg" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/129118_FocalStatstics_Min.jpg" style="width: 620px; height: 408px;" /&gt;&lt;/P&gt;&lt;P&gt;This is in SA Tools / Neighbourhood /&lt;/P&gt;&lt;P&gt;The result cannot be the same...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 07:34:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336299#M26384</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2015-10-01T07:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to fix an Index Error</title>
      <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336300#M26385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's exactly what I ran and the results came out exactly like my DEM - somethings wrong and I'm not sure what. DEM being used as input (notes high and low values):&lt;/P&gt;&lt;P&gt;&lt;IMG alt="DEM.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/129207_DEM.PNG" style="width: 620px; height: 439px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Focal Stats Window:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FocalStatsWindow.PNG" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/129208_FocalStatsWindow.PNG" style="width: 620px; height: 398px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Results (Note image and high/low values are exactly the same as the DEM)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FocalResults.PNG" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/129215_FocalResults.PNG" style="width: 620px; height: 446px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="ResultsWindow.PNG" class="image-4 jive-image" src="https://community.esri.com/legacyfs/online/129217_ResultsWindow.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 14:24:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336300#M26385</guid>
      <dc:creator>RachelAlbritton</dc:creator>
      <dc:date>2015-10-01T14:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to fix an Index Error</title>
      <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336301#M26386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just because the min/max values in the TOC are the same, the internal values (ie the distribution) should / have to be a bit different.&lt;/P&gt;&lt;P&gt;But this is getting a little off the original topic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 14:57:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336301#M26386</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2015-10-01T14:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to fix an Index Error</title>
      <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336302#M26387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm OK with getting a little off topic if the topic leads me to produce the results I need. Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 15:08:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336302#M26387</guid>
      <dc:creator>RachelAlbritton</dc:creator>
      <dc:date>2015-10-01T15:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to fix an Index Error</title>
      <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336303#M26388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a problem with your for loops. When you use RasterToNumPyArray you create a multidimensional array into your myArray variable. I would try adding "&lt;U&gt;" to the second for loop statement as seen below&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for u in range(len(myArray)-1):
&amp;nbsp;&amp;nbsp;&amp;nbsp; for v in range(len(myArray&lt;U&gt;)-1):&lt;/U&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:56:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336303#M26388</guid>
      <dc:creator>DerekNalder</dc:creator>
      <dc:date>2021-12-11T15:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Not sure how to fix an Index Error</title>
      <link>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336304#M26389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the script ran, but all the cells were returned as no data. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 21:27:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/not-sure-how-to-fix-an-index-error/m-p/336304#M26389</guid>
      <dc:creator>RachelAlbritton</dc:creator>
      <dc:date>2015-10-01T21:27:17Z</dc:date>
    </item>
  </channel>
</rss>

