<?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: Python Map Algebra error: Failed to execute (output) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-map-algebra-error-failed-to-execute-output/m-p/567352#M44453</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a formatted version of your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;RI_tif = "C:\\output.tif"

# Process: Get Raster Properties
arcpy.GetRasterProperties_management(v6_tif, "MINIMUM", "")

# Process: Get Raster Properties (2)
arcpy.GetRasterProperties_management(v6_tif, "MAXIMUM", "")

# Process: Raster Calculator (3)
outSubt = (Raster("6.tif")-(float(Property))/((float(Property (2))-(float(Property))
outSubt.save("C:\\output_tif")&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think you're translating very well from the ModelBuilder export.&amp;nbsp; That can be a challenge, but that's how we learn sometimes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following would work better.&amp;nbsp; Note how I'm not working on the root folder of your C drive but one folder beneath it (usually a good idea for many reasons).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy.sa import *
from arcpy import env
env.workspace = "C:\\workspace"
input_tif = "v6.tif" # in c:\workspace
gridmin = float(arcpy.GetRasterProperties_management(input_tif, "MINIMIMUM"))
gridmax = float(arcpy.GetRasterProperties_management(input_tif, "MAXIMUM"))
outRaster = Raster(input_tif) - (gridmin / (gridmax - gridmin))
outRaster.save("output.tif")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 00:26:59 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2021-12-12T00:26:59Z</dc:date>
    <item>
      <title>Python Map Algebra error: Failed to execute (output)</title>
      <link>https://community.esri.com/t5/python-questions/python-map-algebra-error-failed-to-execute-output/m-p/567351#M44452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Jake,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with another equation where I am using minimum and maximum value from my data. I am using the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RI_tif = "C:\\output.tif"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Get Raster Properties&lt;/P&gt;&lt;P&gt;arcpy.GetRasterProperties_management(v6_tif, "MINIMUM", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Get Raster Properties (2)&lt;/P&gt;&lt;P&gt;arcpy.GetRasterProperties_management(v6_tif, "MAXIMUM", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Raster Calculator (3)&lt;/P&gt;&lt;P&gt;outSubt = (Raster("6.tif")-(float(Property))/((float(Property (2))-(float(Property))&lt;/P&gt;&lt;P&gt;outSubt.save("C:\\output_tif")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an error in the last line "Failed to execute (output)." I think that the problem is with the min, max values which I am using in the equation. Probably I implemented them in a wrong way. However, I could not find at ESRI website some example how to do this. Do you have maybe idea how to implement these values in python?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 05:49:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-map-algebra-error-failed-to-execute-output/m-p/567351#M44452</guid>
      <dc:creator>KarolinaKorzeniowska</dc:creator>
      <dc:date>2015-07-09T05:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python Map Algebra error: Failed to execute (output)</title>
      <link>https://community.esri.com/t5/python-questions/python-map-algebra-error-failed-to-execute-output/m-p/567352#M44453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a formatted version of your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;RI_tif = "C:\\output.tif"

# Process: Get Raster Properties
arcpy.GetRasterProperties_management(v6_tif, "MINIMUM", "")

# Process: Get Raster Properties (2)
arcpy.GetRasterProperties_management(v6_tif, "MAXIMUM", "")

# Process: Raster Calculator (3)
outSubt = (Raster("6.tif")-(float(Property))/((float(Property (2))-(float(Property))
outSubt.save("C:\\output_tif")&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think you're translating very well from the ModelBuilder export.&amp;nbsp; That can be a challenge, but that's how we learn sometimes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following would work better.&amp;nbsp; Note how I'm not working on the root folder of your C drive but one folder beneath it (usually a good idea for many reasons).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy.sa import *
from arcpy import env
env.workspace = "C:\\workspace"
input_tif = "v6.tif" # in c:\workspace
gridmin = float(arcpy.GetRasterProperties_management(input_tif, "MINIMIMUM"))
gridmax = float(arcpy.GetRasterProperties_management(input_tif, "MAXIMUM"))
outRaster = Raster(input_tif) - (gridmin / (gridmax - gridmin))
outRaster.save("output.tif")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:26:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-map-algebra-error-failed-to-execute-output/m-p/567352#M44453</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T00:26:59Z</dc:date>
    </item>
  </channel>
</rss>

