Hello, I have followed this example on the documentation:
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">import</SPAN> numpy
<SPAN class="comment token"># Create a simple array from scratch using random values</SPAN>
myArray <SPAN class="operator token">=</SPAN> numpy<SPAN class="punctuation token">.</SPAN>random<SPAN class="punctuation token">.</SPAN>random_integers<SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">100</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">2500</SPAN><SPAN class="punctuation token">)</SPAN>
myArray<SPAN class="punctuation token">.</SPAN>shape <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="number token">50</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">50</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Convert array to a geodatabase raster</SPAN>
myRaster <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>NumPyArrayToRaster<SPAN class="punctuation token">(</SPAN>myArray<SPAN class="punctuation token">,</SPAN>x_cell_size<SPAN class="operator token">=</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>
myRaster<SPAN class="punctuation token">.</SPAN>save<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"C:/output/fgdb.gdb/myRandomRaster"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
This code creates a raster file in my geodatabase, but the rasterfile appears to be empty. When I add the raster to ArcMap, the raster is invisible. Only if I check to "Display NoData values as" a color, I can see the raster. It seems like the raster is full of NoData.
How can I get a simple random NumPy array to correctly show up in a map document?
Thanks in advance!